Skip to content

Instantly share code, notes, and snippets.

@femiyb
Last active April 7, 2021 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femiyb/1a930d7d0fc1c2856e2488514a77b3bc to your computer and use it in GitHub Desktop.
Save femiyb/1a930d7d0fc1c2856e2488514a77b3bc to your computer and use it in GitHub Desktop.
<?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