Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/eaef6026eed37638d3e3d2dd6fa08d0a to your computer and use it in GitHub Desktop.
Save dwanjuki/eaef6026eed37638d3e3d2dd6fa08d0a to your computer and use it in GitHub Desktop.
This recipe will BCC additional email addresses when a member expired
<?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