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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Issue with Email::send_all_emails_to();


Go to End


3 Posts   1630 Views

Avatar
pingu

Community Member, 75 Posts

17 January 2011 at 10:51pm

Edited: 17/01/2011 10:58pm

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

Forum Moderator, 5523 Posts

18 January 2011 at 4:52pm

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

Community Member, 75 Posts

18 January 2011 at 5:06pm

Edited: 18/01/2011 5:10pm

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