Forked from strangerstudios/my_pmpro_email_headers_bcc.php
Created
July 17, 2020 15:34
-
-
Save femiyb/acaf9522cd7f3ced22b053ae3c545b63 to your computer and use it in GitHub Desktop.
BCC a second email address on PMPro admin emails.
This file contains 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
/* | |
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