Forked from kimwhite/my_pmpro_email_headers_admin_emails.php
Last active
April 4, 2025 15:14
-
-
Save dwanjuki/eaef6026eed37638d3e3d2dd6fa08d0a to your computer and use it in GitHub Desktop.
This recipe will BCC additional email addresses when a member expired
This file contains hidden or 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 line. | |
/** | |
* This recipe will BCC additional email addresses when a member expired | |
* | |
* 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_bcc_membership_expired_email( $headers, $email ) { | |
if ( 'membership_expired' == $email->template ) { | |
// add bcc | |
$headers[] = 'Bcc:' . '[email protected]'; | |
} | |
return $headers; | |
} | |
add_filter( 'pmpro_email_headers', 'my_pmpro_bcc_membership_expired_email', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment