-
-
Save strangerstudios/4206776 to your computer and use it in GitHub Desktop.
/* | |
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); |
Do not update the PMPro plugin files. Paste this into your active theme's functions.php file or a custom plugin. More info on creating a custom plugin here:
http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
Thanks Jason. I'm going to try this. Some of the other gists didn't work for me. Is there a benefit to using this code in a custom plugin over the functions file or vice versa?
rwilki +1
Is there a benefit to using this code in a custom plugin over the functions file or vice versa?
Late reply, but if you put it in a custom plugin you won't lose the functionality if you change your theme and it's also easier to copy to another site that isn't using the same theme.
In general, code in the theme folder (including the functions.php) should all be related to themey type stuff (visuals, design, frontend stuff) and customizations like this should go into a custom plugin. However, the functions.php of the active theme is something that 99% of WP sites already have and is a quick way to get one little customization onto a WP site.
Hello there,
I need to know, how should I send CC/BCC on new registration to 4 emails addresses?
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/
Jason,
The gistfile above was provided to me from Stranger Studios to use for Paid Membership Pro. I am a bit of a novice developer here, so I am curious to know exactly where I paste this code? I assume it is .php and gets placed into th PMP plug-in? Can you advise?
Thank you.