Forked from andrewlimaza/pmpro-change-admin-to-email.php
Last active
September 7, 2021 15:56
-
-
Save MaryOJob/2a1a83d44b14c7a8e41f34d4761a411f to your computer and use it in GitHub Desktop.
Add bcc for PMPro admin emails [Paid Memberships Pro]
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
<?php // do not copy this line | |
/** | |
* Add bcc for PMPro admin emails | |
* Follow this guide to add custom code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
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:" . "mary@paidmembershipspro.com"; // bcc'ing only one email? Comment out or remove line 16 | |
$headers[] = "Bcc:" . "mary@paidmembershipspro.com, seunjob@yahoo.com"; // bcc more than one email | |
} | |
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