Skip to content

Instantly share code, notes, and snippets.

@ipokkel
Created March 20, 2024 06:18
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 ipokkel/1191cff25e6a1a332e781ce42f553bc6 to your computer and use it in GitHub Desktop.
Save ipokkel/1191cff25e6a1a332e781ce42f553bc6 to your computer and use it in GitHub Desktop.
BCC Activity report email to additional email addresses
<?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