我按照帮助指南将 trustpilot 的 SFA 集成到 prestashop 中,他们的指南基于发送订单确认。发送订单确认后,trustpilot 服务会收到一封密件抄送电子邮件,并将该电子邮件添加到发送队列以请求审核。问题可能是:
1) 订单完成但付款失败 > 邮件已发送 2) 订单已完成并付款正常但客户想删除订单 > 电子邮件已发送
因此解决方案是在订单发货状态达到时发送密件抄送电子邮件。当后台操作员手动更改发货状态时,客户将收到发货的模板电子邮件。
我不是 prestashop 覆盖和编程方面的专家,所以我尝试像这样覆盖 mail.php 类:
<?php
class Mail extends MailCore
{
public static function Send($id_lang, $template, $subject, $template_vars, $to,
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
$template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
{
// add trustpilot SFA 2.0
if($template == 'shipped')
{
$bcc->addBcc('*********@invite.trustpilot.com');
}
// send to customer
$ret = parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop, $bcc, $reply_to);
return $ret;
}
?>
我不知道这是否正确,但在制造混乱之前我需要任何帮助:)
谢谢