What's New
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.
Tagged: Email
Hi!
I was crazy looking the reason why the popup newsletter module was not sending emails when a customer register in the newsletter, voucher email, etc.
I found that this is a Prestashop bug that is happening too with default ps_emailsubscription module. This bug is still not fixed by Prestashop, but someone posted a fix on github that is also working with the Transformer popup newsletter module.
Here is the link:
https://github.com/PrestaShop/PrestaShop/issues/9810
Just need to add this code in the file stnewsletter.php of the module /stnewsletter. Just add as say in the github page.
Search this code:
public function hookActionCustomerAccountAdd($params)
{
//if e-mail of the created user address has already been added to the newsletter through the ps_emailsubscription module,
//we delete it from ps_emailsubscription table to prevent duplicates
$id_shop = $params['newCustomer']->id_shop;
$email = $params['newCustomer']->email;
if (Validate::isEmail($email)) {
Just here, ADD this code:
//START MODIFICATION
//new line sending confirmation email
$this->sendConfirmationEmail($email);
//new IF checking if there is a discount to send to customer
if ($discount = Configuration::get('NW_VOUCHER_CODE')) {
$this->sendVoucher($email, $discount);
}
//END MODIFICATION
This is the rest of the original code:
return (bool) Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'emailsubscription WHERE id_shop='.(int) $id_shop.' AND email=\''.pSQL($email)."'");
}
return true;
}
Will be interesting if you can fix this in the next update 🙂
I hope I helped, I was looking for fixing this for a long time, I don’t understand how Prestashop can have this king of bugs on every new version without fixing 🙁
Best regards!
Hi,
Yes, customers who ticked the “Newsletter” option can get the notification in my fixation.
Best regards.
Hi yobo,
Can you please share the fix or the file so I can fix on my site?
Thank you very much!
Hi,
Please use my following code instead of yours:
// Send email notification
if (Tools::getValue('newsletter')) {
if ($discount = Configuration::get('ST_NW_VOUCHER_CODE')) {
$this->sendVoucher($email, $discount);
}
if (Configuration::get('ST_NW_CONFIRMATION_EMAIL')) {
$this->sendConfirmationEmail($email);
}
}
See attached screenshot.
Best regards.
You must be logged in to reply to this topic.