This commit is contained in:
2025-11-26 20:33:34 +01:00
parent 6545e78352
commit 0cd2c34e30

View File

@@ -684,29 +684,29 @@ class Ps_EmailAlerts extends Module
];
// Do not send mail if multiples product are created / imported.
if (!defined('PS_MASS_PRODUCT_CREATION')
&& file_exists(dirname(__FILE__) . '/mails/' . $iso . '/productoutofstock.txt')
&& file_exists(dirname(__FILE__) . '/mails/' . $iso . '/productoutofstock.html')) {
// Send 1 email by merchant mail, because Mail::Send doesn't work with an array of recipients
$merchant_oos_emails = explode(self::__MA_MAIL_DELIMITER__, $this->merchant_oos_emails);
foreach ($merchant_oos_emails as $merchant_mail) {
Mail::Send(
$id_lang,
'productoutofstock',
$this->trans('Product out of stock', [], 'Emails.Subject', $locale),
$template_vars,
$merchant_mail,
null,
(string) $configuration['PS_SHOP_EMAIL'],
(string) $configuration['PS_SHOP_NAME'],
null,
null,
dirname(__FILE__) . '/mails/',
false,
$id_shop
);
}
}
// if (!defined('PS_MASS_PRODUCT_CREATION')
// && file_exists(dirname(__FILE__) . '/mails/' . $iso . '/productoutofstock.txt')
// && file_exists(dirname(__FILE__) . '/mails/' . $iso . '/productoutofstock.html')) {
// // Send 1 email by merchant mail, because Mail::Send doesn't work with an array of recipients
// $merchant_oos_emails = explode(self::__MA_MAIL_DELIMITER__, $this->merchant_oos_emails);
// foreach ($merchant_oos_emails as $merchant_mail) {
// Mail::Send(
// $id_lang,
// 'productoutofstock',
// $this->trans('Product out of stock', [], 'Emails.Subject', $locale),
// $template_vars,
// $merchant_mail,
// null,
// (string) $configuration['PS_SHOP_EMAIL'],
// (string) $configuration['PS_SHOP_NAME'],
// null,
// null,
// dirname(__FILE__) . '/mails/',
// false,
// $id_shop
// );
// }
// }
}
if ($product_has_attributes) {