Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save femiyb/acaf9522cd7f3ced22b053ae3c545b63 to your computer and use it in GitHub Desktop.
Save femiyb/acaf9522cd7f3ced22b053ae3c545b63 to your computer and use it in GitHub Desktop.
BCC a second email address on PMPro admin emails.
/*
Add bcc for PMPro admin emails.
Change otheremail@domain.com,anotheremail@domain.com below to the addresses you want to use.
Add this code to your active theme's functions.php or a custom plugin
a la http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_email_headers_bcc($headers, $email)
{
//bcc emails going to admins
if(strpos($email->template, "admin") !== false)
{
//add bcc
$headers[] = "Bcc:" . "otheremail@domain.com,anotheremail@domain.com";
}
return $headers;
}
add_filter("pmpro_email_headers", "my_pmpro_email_headers_bcc", 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment