Created
December 14, 2023 12:08
-
-
Save JarrydLong/026ba466d8b4ebd0188cbeb547f4d96c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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