Forked from strangerstudios/my_pmpro_email_headers_admin_emails.php
Last active
September 28, 2021 09:57
-
-
Save MaryOJob/63eb1fb7aeee05d606acc8e4b27f970c to your computer and use it in GitHub Desktop.
CC two additional emails on PMPro admin 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
<?php // do not copy this line | |
/* Add CC for PMPro admin emails | |
* Add this snippet to your PMPro Customization Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_headers_admin_emails($headers, $email) { | |
//cc emails already going to admin_email | |
if(strpos($email->template, '_admin') !== false) | |
{ | |
//add cc | |
$headers[] = 'cc:' . 'otheremail@domain.com, otheremail2@domain.com'; // type in your email address here please. | |
// if you want to cc only one email:, replace line 12 with: $headers[] = 'cc:' . '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