Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/04ac1ff59a035c3b013834a02e39828f to your computer and use it in GitHub Desktop.
Save kimwhite/04ac1ff59a035c3b013834a02e39828f to your computer and use it in GitHub Desktop.
<?php // do not copy this line.
/**
* This recipe will BCC additional emails addresses when an the expiriing or expired email user receives.
*
* 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/
*/
/*
Add bcc for checkout emails
*/
function my_pmpro_email_headers_admin_emails($headers, $email)
{
//bcc checkout emails
if($email->template == "membership_expiring" || $email->template == "membership_expired")
{
//add bcc
$headers[] = "Bcc:" . "[email protected],[email protected]";
}
return $headers;
}
add_filter("pmpro_email_headers", "my_pmpro_email_headers_admin_emails", 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment