Home / Archive / MemberPress: Enabling Payment Receipt Email for Free Recurring Subscriptions
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Enabling Payment Receipt Email for Free Recurring Subscriptions

By default, MemberPress doesn’t send the payment receipt email for free recurring membership registrations.

This code snippet will send the payment receipt email for transactions with zero amount. This is useful for cases where the payment receipt is needed for free subscriptions, or when a discount code is used to reduce the purchase amount to zero.

Code Preview
php
<?php
function mepr_capture_recurring_sub( $event ) {
    // Get the transaction data from the event
    $txn = $event->get_data();
    // Send the transaction receipt email
    MeprUtils::send_transaction_receipt_notices( $txn );
}
// Attach the 'mepr_capture_recurring_sub' function to the 'mepr-event-subscription-payment-completed' event.
add_action( 'mepr-event-transaction-completed', 'mepr_capture_recurring_sub' );

Comments

Add a Comment