Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Issue with Email::send_all_emails_to();


Reply

3 Posts   1071 Views

Avatar
pingu

17 January 2011 at 10:51pm (Last edited: 17 January 2011 10:58pm), Community Member, 75 Posts

Hi guys,

We're running a site on Silverstripe 2.4.0, and we've encountered a strange issue with email notifications sent through the site.

If we add Email::send_all_emails_to("debug@xyz.com") to the site's _config file, emails are sent to the email address defined in the send_emails_to() ONLY, and not to the desired recipients.

If we remove send_all_emails_to(), the email notifications are sent to recipients as expected.

If we use Email::bcc_all_emails_to("debug@xyz.com"), then the emails are sent to the debug address as well as to recipients as expected.

The behavior is replicated on the live site, and dev and staging versions (all running on different servers). Just wondering if anyone's encountered anything like this, and knows what might be causing the issue?

It seems quite a critical issue - it went unnoticed by the clients for a few weeks as the emails were sent to the debug address fine (so they assumed they were working fine), but never reached the desired recipients.

Avatar
Willr

18 January 2011 at 4:52pm Forum Moderator, 5511 Posts

If we add Email::send_all_emails_to("debug@xyz.com") to the site's _config file, emails are sent to the email address defined in the send_emails_to() ONLY, and not to the desired recipients.

This is how its designed. It was implemented for on dev / test modes to send all emails to the developer rather than potentially emailing entire mailing lists by mistake (happened a couple times from test servers).

Like you mentioned if you want the original recipients to get mail use bcc_all_emails_to or cc.

Avatar
pingu

18 January 2011 at 5:06pm (Last edited: 18 January 2011 5:10pm), Community Member, 75 Posts

Great, thanks for the explanation Willr, to me this wasn't clear in the documentation at the time. Thanks!