Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Issue with Email::send_all_emails_to();

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

Page: 1
Go to End
Author Topic: 1047 Views
  • pingu
    Avatar
    Community Member
    75 Posts

    Issue with Email::send_all_emails_to(); Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Issue with Email::send_all_emails_to(); Link to this post

    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.

  • pingu
    Avatar
    Community Member
    75 Posts

    Re: Issue with Email::send_all_emails_to(); Link to this post

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

    1047 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.