Skip to content

Instantly share code, notes, and snippets.

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 MaryOJob/2a1a83d44b14c7a8e41f34d4761a411f to your computer and use it in GitHub Desktop.
Save MaryOJob/2a1a83d44b14c7a8e41f34d4761a411f to your computer and use it in GitHub Desktop.
Add bcc for PMPro admin emails [Paid Memberships Pro]
<?php // do not copy this line
/**
* Add bcc for PMPro admin emails
* Follow this guide to add custom code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_email_headers_admin_emails($headers, $email)
{
//bcc emails already going to admin_email
if(strpos($email->template, "_admin") !== false){
//add bcc
// $headers[] = "Bcc:" . "mary@paidmembershipspro.com"; // bcc'ing only one email? Comment out or remove line 16
$headers[] = "Bcc:" . "mary@paidmembershipspro.com, seunjob@yahoo.com"; // bcc more than one email
}
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