Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JarrydLong/026ba466d8b4ebd0188cbeb547f4d96c to your computer and use it in GitHub Desktop.
Save JarrydLong/026ba466d8b4ebd0188cbeb547f4d96c to your computer and use it in GitHub Desktop.
<?php //do not copy
/**
* This recipe sends a different 'Application Approved' email when approving a member
* in the Approvals Add On based on their level.
*
* Does not support email templates at this point in time. Subject & Body should be updated in the code below.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
function my_pmpro_email_filter( $email ){
if($email->template == 'application_approved'){
if($email->data['membership_id'] == 1 ){
$email->subject = 'Your Membership 1 Has Been Approved';
$email->body = 'This is the content/body of the email for members who are approved for level 1';
}
if($email->data['membership_id'] == 2 ){
$email->subject = 'Your Membership 2 Has Been Approved';
$email->body = 'This is the content/body of the email for members who are approved for level 2';
}
}
return $email;
}
add_filter('pmpro_email_filter', 'my_pmpro_email_filter', 99, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment