0
我已經使用Mail::Send()
函數發送郵件,但它不起作用,爲什麼?Prestashop - 如何在客戶訂閱缺貨產品時發送電子郵件通知?
文件/mailalerts/controllers/front/actions.php: https://github.com/PrestaShop/mailalerts/blob/master/controllers/front/actions.php
在processAdd()
功能,if ($mail_alert->add() !== false)
之前我已經加入這個:
if ($mail_alert->add() !== false) {
die('1');
$product_name = Product::getProductName($id_customer);
$shop_email = '[email protected]';
$shop_name = Configuration::get('PS_SHOP_NAME');
$dir_mail = dirname(__FILE__).'/../../mails/';
$template_vars = array(
'{customer_email}' => $customer_email,
'{product_name}' => $product_name
);
Mail::Send(
$id_lang,
'new_oos',
Mail::l('New request of product', $id_lang),
$template_vars,
(string)$shop_email,
null,
(string)$shop_email,
(string)Configuration::get('PS_SHOP_NAME', null, null, $id_shop),
null,
null,
$dir_mail,
false,
$id_shop
);
} else {
die('0');
}
}
如何發送電子郵件給我?
郵件設置配置。這不是問題。 P.S:將電子郵件模板(new_oos.html和new_oos.txt)添加到mailalerts/mails/en /文件夾中。 – tRACE
然後,你可以在ActionProductUpdate鉤子函數中定義你的代碼。 – MAC
我不明白。爲了什麼?以及如何做到這一點? – tRACE