How would I add a BCC to all outgoing email

We are moving our outgoing email and I have a request to add a BCC to all outgoing emails from the system for a while.  Has anyone ever done something like this?  It will be the same email every time.

Parents
  • If it's only emails that the users send (from the UI) - we can extend the MailApi and create a CustomMailApi in custom/modules/Emails/clients/base/api/CustomMailApi.php. In the handleMail method we can add the BCC in the request args. 

    If you want to add emails for all outgoing emails (eg: auto replies, system emails, etc) - And since you say it's temporary - a non-upgrade safe approach is to directly modify modules/Emails/Email.php - and add your BCC whenever $mailer->send() is called. But since it's non upgrade safe - you can't do this in Cloud.

Reply
  • If it's only emails that the users send (from the UI) - we can extend the MailApi and create a CustomMailApi in custom/modules/Emails/clients/base/api/CustomMailApi.php. In the handleMail method we can add the BCC in the request args. 

    If you want to add emails for all outgoing emails (eg: auto replies, system emails, etc) - And since you say it's temporary - a non-upgrade safe approach is to directly modify modules/Emails/Email.php - and add your BCC whenever $mailer->send() is called. But since it's non upgrade safe - you can't do this in Cloud.

Children