Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MaryOJob/2a1a83d44b14c7a8e41f34d4761a411f to your computer and use it in GitHub Desktop.
Save MaryOJob/2a1a83d44b14c7a8e41f34d4761a411f to your computer and use it in GitHub Desktop.
Add bcc for PMPro admin emails [Paid Memberships Pro]
<?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) {
// Ensure headers is an array
if (!is_array($headers)) {
$headers = [];
}
// Add BCC recipients
$headers[] = 'Bcc: [email protected], [email protected]';
}
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