Forked from strangerstudios/my_pmpro_email_headers_admin_emails.php
Last active
January 28, 2022 02:49
-
-
Save LMNTL/3162ad9035f0bc77a03ea83ee8afa2ca to your computer and use it in GitHub Desktop.
BCC an additional email on PMPro admin emails. Works with PMPro Approvals 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 | |
*/ | |
function my_pmpro_email_headers_admin_emails($headers, $email) | |
{ | |
$approval_admin = array( "admin_approved", "admin_denied", "admin_notification" ); | |
//bcc emails already going to admin_email | |
if( strpos($email->template, "_admin") !== false || in_array($email->template, $approval_admin) ) | |
{ | |
//add bcc | |
$headers[] = "Bcc:" . "[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