1

Using the latest EE 2.7.3 and MX Notify 2.4.6 (tested on a fresh install), setting up a notification for anything, eg. a new entry posted, and notifying a user group or mailing list (or combination) with more than 1 email address in the array only sends to the first email address the system processes.

I've played around with setting different email config settings, but to no avail. The system can send via the communicate tab to more than 1 address, so it must be a problem with MX Notify.

The eec.ms forums don't allow registration, so I'm posting here in case someone can help.

3
  • What do you mean by "1 email address in the array"? Not the email input of the notify-settings?
    – GDmac
    Jan 8, 2014 at 5:49
  • How are you setting the addresses to which you wish to send email? Is it in the form itself (in which case can you post your code)? Or are you setting them in the form notification set up? How are you separating the addresses? Are you using BCC?
    – foamcow
    Jan 8, 2014 at 9:03
  • I shouldn't have used the word array, it's only seemed to confuse others. In the MX Notify extention settings, the 'To Email' field is blank (comma separated emails in here will send to multiple addresses by the look of it). A checkbox in the 'To Mailing List' option is checked, and that mailing list will have more than 1 address within it.
    – andparsons
    Jan 8, 2014 at 9:10

1 Answer 1

2

It seems that adding

$this->EE->email->initialize();
$this->EE->email->from($site_settings['email_' . $iRow] != '' ? $site_settings['email_' . $iRow] :  $this->EE->config->item('webmaster_email'), ($site_settings['from_' . $iRow] != '') ? $site_settings['from_' . $iRow] : $this->EE->config->item('webmaster_name'));

To the top of the foreach sending loop fixes the problem.

    if (count($emailTo) != 0 )
    {
        foreach ($emailTo as $key => $val)
        {
            $this->EE->email->initialize();
            $this->EE->email->from($site_settings['email_' . $iRow] != '' ? $site_settings['email_' . $iRow] :  $this->EE->config->item('webmaster_email'), ($site_settings['from_' . $iRow] != '') ? $site_settings['from_' . $iRow] : $this->EE->config->item('webmaster_name'));
            $this->EE->email->to($val['mbr_email']);
            $this->EE->email->subject($this->templater($email_sabj_tmp, $val));
            $this->EE->email->message(entities_to_ascii($this->templater($msg_body_tmp, $val)), (($plaintext_alt_tmp != '') ? $this->templater($plaintext_alt_tmp, $val) : ''));
            $this->EE->email->Send();

        }
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.