Jump to content

Order confirmation email (mailalert not working)... going crazy


uddhava

Recommended Posts

I have been trying and trying and i am ready to go crazy. I try to setup a way that the shop owner will get an order confirmation email without using the mailalerts module. Why without mailalerts? Because the mailalerts module does not function. Emails are not sent out.

And yes all other email (contact form/backend statusses) ARE sent so that works. I tried to change the Mail.php class to sent an extra BCC, but that only doesnt work when a new order is created.
It drives me nuts. It seems that new order emails are only sent when mailalerts is installed.

So where in what file / class do i need to add some code to get the new_order sending an extra email?

Link to comment
Share on other sites

I tried adding this code to the Mail.php class (this is 1.3.7 so no override possible). I hoped that all mail sent will be handled by this class, but obviously new order mails are not.

New code in Mail.php (from line 56)

foreach ($to as $key => $addr)
           {
               $to_name = NULL;
               $addr = trim($addr);
               if (!Validate::isEmail($addr))
                   die(Tools::displayError('Error: mail parameters are corrupted'));
               if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key]))
                   $to_name = $toName[$key];
               $to_list->addTo($addr, $to_name);
               $to_list->addBcc($configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME']);
           }
           $to_plugin = $to[0];
           $to = $to_list;
       } else {
           /* Simple recipient, one address */

               $to_list = new Swift_RecipientList();
               $to_list->addTo($to, $toName);
               $to_list->addBcc($from, $fromName);
               $to_plugin = $to;
               $to = $to_list;

               //$to_plugin = $to;
               //$to = new Swift_Address($to, $toName);
}

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...