Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewlimaza/0f33ddf6db7789ec583e2e6a0fb36283 to your computer and use it in GitHub Desktop.
Save andrewlimaza/0f33ddf6db7789ec583e2e6a0fb36283 to your computer and use it in GitHub Desktop.
BCC an additional email on PMPro admin checkout emails only.
/*
Add bcc for PMPro admin emails
*/
function my_pmpro_email_headers_admin_emails($headers, $email) {
//bcc emails already going to admin_email
if(strpos($email->template, "_admin") !== false && strpos($email->template, "checkout") !== false)
{
//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