Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LMNTL/3162ad9035f0bc77a03ea83ee8afa2ca to your computer and use it in GitHub Desktop.
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.
/*
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:" . "otheremail@domain.com";
}
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