Last active
April 16, 2021 01:19
-
-
Save strangerstudios/4206776 to your computer and use it in GitHub Desktop.
BCC all Paid Memberships Pro Emails to a Certain Address
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
/* | |
Bcc admin on PMPro member only emails | |
You can change the conditional to check for a certain $email->template or some other condition before adding the BCC. | |
*/ | |
function my_pmpro_email_headers($headers, $email) | |
{ | |
//bcc emails not already going to admin_email | |
if($email->email != get_bloginfo("admin_email")) | |
{ | |
//add bcc | |
$headers[] = "Bcc:" . get_bloginfo("admin_email"); | |
} | |
return $headers; | |
} | |
add_filter("pmpro_email_headers", "my_pmpro_email_headers", 10, 2); |
This recipe is included in the blog post on "BCC Additional Email Addresses on Member or Admin Notifications" at Paid Memberships Pro here: https://www.paidmembershipspro.com/bcc-additional-email-addresses-on-member-or-admin-notifications/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there,
I need to know, how should I send CC/BCC on new registration to 4 emails addresses?