How can all E-mails be sent with BCC copy to Admin?

I'm translating WordPress page into seven different languages. Have around 70 plugins active and working, no worries. Subscriptions, shop, pre-orders you name it.

Getting there with translations, using WPML but I have not found, not even searching, all templates for emails going out to users, customers, shop editors, bloggers, etc.

I'm sending all emails out through Mailster. Is there a way that would be Admin able to get BCC copy of each and every e-mail sending out? I would take a solution for Mailster or directly for WordPress, though. That would be the easiest way for me to see what I still need to translate.

Cheers

Topic translation email admin Wordpress

Category Web


I faced the same problem, and was able to solve it with a hook which is not listed in Mailster's documentation.

add_action( 'mailster_presend',function($mailster) {
    $mailster->bcc = array('[email protected]');
}, 1, 5);

Just add the code snippet to your functions.php and change the email address to your BCC email.

You can also add a CC recipient, but this is rather unnecessary for automated emails.

add_action( 'mailster_presend',function($mailster) {
    $mailster->cc = array('[email protected]');
}, 1, 5);

Depending on how Mailster handles WP's email processing (which is actually out-of-scope here), you could probably do it by adding a BCC when phpMailer is initialized. In a pure WP sense, that would add your BCC to any email being handled through wp_mail().

add_action( 'phpmailer_init', function( $phpmailer ) {
    $phpmailer->addBCC( '[email protected]' );
});

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.