Last active
April 7, 2021 20:54
-
-
Save femiyb/1a930d7d0fc1c2856e2488514a77b3bc 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 | |
/** | |
* This recipe will forward the Membership Expiring email to another email address | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_recipient($headers, $email) { | |
if(strpos($email->template, 'membership_expiring')){ | |
$headers[] = "Bcc:" . "otheremail@domain.com"; | |
} | |
return $headers; | |
} | |
add_filter('pmpro_email_recipient', 'my_pmpro_email_recipient', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment