Created
March 20, 2024 06:18
-
-
Save ipokkel/1191cff25e6a1a332e781ce42f553bc6 to your computer and use it in GitHub Desktop.
BCC Activity report email to additional email addresses
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 | |
/** | |
* BCC additional email addresses on the admin activity email. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_bcc_admin_activity_email( $headers, $email ) { | |
if ( 'admin_activity_email' === $email->template ) { | |
$headers[] = 'Bcc:' . 'other1@email.com, other2@email.com, other3@email.com'; | |
} | |
return $headers; | |
} | |
add_filter( 'pmpro_email_headers', 'my_pmpro_email_bcc_admin_activity_email', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment