Last active
September 22, 2021 19:40
-
-
Save MaryOJob/b53489dce5ba3c2133f56e2f533ce710 to your computer and use it in GitHub Desktop.
BCC all PMPro Emails to More Than One Email Address
This file contains hidden or 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
<?php // Do not copy this line | |
/* | |
Bcc more than one admin on PMPro members 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_admin_emails($headers, $email) | |
{ | |
//bcc emails already going to admin_email | |
if(strpos($email->template, "_admin") !== false) | |
{ | |
//add bcc | |
$headers[] = "Bcc:" . "[email protected], [email protected]"; | |
} | |
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