Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Last active September 22, 2021 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryOJob/b53489dce5ba3c2133f56e2f533ce710 to your computer and use it in GitHub Desktop.
Save MaryOJob/b53489dce5ba3c2133f56e2f533ce710 to your computer and use it in GitHub Desktop.
BCC all PMPro Emails to More Than One Email Address
<?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:" . "otheremail@domain.com, otheremail+2@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