Jump to content

[SOLVED] bug in module mailalerts : no mails to admin


Recommended Posts

I have been strugling with this problem for some time and finally found a solution.

 

I'm running PS 1.5.3.1 and since my upgrade to version 1.5 and above I did not get an order confirmation mail anymore to my admin account when a new order was placed by a customer.

 

All version before 1.5 (1.4) worked fine. I've been looking at the various solutions for this problem in the forum and tried all suggestion (change smtp, check language folder and files, mailalert module configuration etc) but all was correct and I did not receive the admin mails.

 

What is specific for my PS is that I use only one language and it isn't Englisch (en). I use as standard language dutch (nl) and this is the only language i use.

 

I was able to resolve the problem by replacing the file /modules/mailalerts/mailalerts.php from my 1.5.3 installation with an older version of my 1.4 shop.

 

Then i started debugging the original mailalerts.php from 1.5.3.1 and came to the following conclusion :

 

on line 335 right after

$template = 'new_order';

 

add following :

$subject = $this->l('New order', false, (int)$id_lang).' - '.sprintf('%06d', $order->id);

 

line 385

replace

$iso = Language::getIsoById($id_lang);

with

$iso = Language::getIsoById((int)$id_lang);

 

line 389

replace

Mail::Send( $id_lang, $template, sprintf(Mail::l('New order - #%06d', $id_lang), $order->id), template_vars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), null, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], null, null, dirname(__FILE__).'/mails/' );

 

with

Mail::Send((int)$id_lang, $template, $subject, $template_vars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), null, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], null, null, dirname(__FILE__).'/mails/');

 

This does the trick and everything works fine.

 

PS developpers will probably have to clean up this code and solve the bug for next versions.

 

Just wanted to share...

  • Like 3
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...
×
×
  • Create New...