[Site Cache + Dynamic Modules for Prestashop] How to fix bug related with prestashop system - Sending Mails not working - only for Prestashop 1.7.x.x ?



This problem maybe related with prestashop system

 

Try this changes:

 

1. /classes/Mail.php - line 113 - 135

 

replace code:

 

 

$skip = array_reduce(Hook::exec(
'actionEmailSendBefore',
array(
'idLang' => &$idLang,
'template' => &$template,
'subject' => &$subject,
'templateVars' => &$templateVars,
'to' => &$to,
'toName' => &$toName,
'from' => &$from,
'fromName' => &$fromName,
'fileAttachment' => &$fileAttachment,
'mode_smtp' => &$mode_smtp,
'templatePath' => &$templatePath,
'die' => &$die,
'idShop' => &$idShop,
'bcc' => &$bcc,
'replyTo' => &$replyTo
),
null,
true
), function ($carry, $item) {
return $carry && $item;
}, true);

 

on the:

 


$actionEmailSendBefore = Hook::exec(
'actionEmailSendBefore',
array(
'idLang' => &$idLang,
'template' => &$template,
'subject' => &$subject,
'templateVars' => &$templateVars,
'to' => &$to,
'toName' => &$toName,
'from' => &$from,
'fromName' => &$fromName,
'fileAttachment' => &$fileAttachment,
'mode_smtp' => &$mode_smtp,
'templatePath' => &$templatePath,
'die' => &$die,
'idShop' => &$idShop,
'bcc' => &$bcc,
'replyTo' => &$replyTo
),
null,
true
);
if(strlen($actionEmailSendBefore)==0){
$actionEmailSendBefore = array();
}

$skip = array_reduce($actionEmailSendBefore, function ($carry, $item) {
return $carry && $item;
}, true);



You will also find other SPM Prestashop Modules