Email Filters

All email messages and subjects have their own filters. You can use these to change the message contents for each subscription level or based on any other user/subscription details. This is also useful if you want to send emails in multiple languages.

Here's a full list:

Active Subscription Email:

$message = apply_filters( 'rcp_subscription_active_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_active_subject', $subject, $user_id, $status );

Cancelled Subscription Email:

$message = apply_filters( 'rcp_subscription_cancelled_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_cancelled_subject', $subject, $user_id, $status );

Expired Subscription Email:

$message = apply_filters( 'rcp_subscription_expired_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_expired_subject', $subject, $user_id, $status );

Free Subscription Email:

$message = apply_filters( 'rcp_subscription_free_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_free_subject', $subject, $user_id, $status );

Trial Subscription Email:

$message = apply_filters( 'rcp_subscription_trial_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_trial_subject', $subject, $user_id, $status );

Expiring Soon Email:

$message   = apply_filters( 'rcp_expiring_soon_email', $message, $user_id );
$subject   = apply_filters( 'rcp_expiring_soon_subject', $subject, $user_id );

Payment Received Email:

$message = apply_filters( 'rcp_payment_received_email', $message, $payment_id, $args );

In this email, the user ID can be obtained with $args['user_id']

Renewal Payment Failure Email:

$message = apply_filters( 'rcp_subscription_renewal_payment_failed_email', $message, $user_id, $status );
$subject = apply_filters( 'rcp_subscription_renewal_payment_failed_subject', $subject, $user_id, $status );

Example Usage

function ag_new_subscription_active_email( $message, $user_id, $status ) {
    $member = new RCP_Member( $user_id );
    $subscription_id = $member->get_subscription_id();

    // Change the email contents if they're on level #3.
    if( 3 == $subscription_id ) {
        $message = __( 'Your new message can go in here.', 'rcp' );
    }

    return $message;
}

add_filter( 'rcp_subscription_active_email', 'ag_new_subscription_active_email', 10, 3 );