Prestashop 1.6.1.13 和 TrustPilot SFA 2.0 服务
Prestashop 1.6.1.13 and TrustPilot SFA 2.0 service
我按照帮助指南将trustpilot的SFA集成到prestashop中,但他们的指南是基于发送订单确认。
发送订单确认后,trustpilot 服务会收到一封密件抄送电子邮件,并将该电子邮件添加到发送队列中以请求审核。
问题可能是:
1) 订单已完成但付款失败 > 邮件已发送
2) 订单已完成并已付款,但客户想删除订单 > 电子邮件已发送
因此解决方案是在达到订单发货状态时发送密件抄送电子邮件。
当后台操作员手动更改发货状态时,客户将收到发货模板电子邮件。
我不是 prestashop 覆盖和编程方面的专家,所以我尝试像这样覆盖 mail.php class:
<?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;
}
?>
我不知道它是否正确,但在制造混乱之前我需要任何帮助:)
谢谢
我以这个可行的解决方案结束。
我 post 这里的代码所以如果有人需要这种方式工作:
<?php
/*
MODIFIED VERSION TO SUPPORT TRUSTPILOT SEND ON SHIPPED STATUS CHANGE
*/
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)
{
if($template == 'shipped') { $bcc = array('xxxx@invite.trustpilot.com'); }
return 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);
}
}
现在我只有一个问题:shipped.html 没有 {mail} 占位符。我如何覆盖 AdminOrdersController.php 以允许我在邮件模板中添加新的 {mail} 占位符?
太
我按照帮助指南将trustpilot的SFA集成到prestashop中,但他们的指南是基于发送订单确认。 发送订单确认后,trustpilot 服务会收到一封密件抄送电子邮件,并将该电子邮件添加到发送队列中以请求审核。 问题可能是:
1) 订单已完成但付款失败 > 邮件已发送 2) 订单已完成并已付款,但客户想删除订单 > 电子邮件已发送
因此解决方案是在达到订单发货状态时发送密件抄送电子邮件。 当后台操作员手动更改发货状态时,客户将收到发货模板电子邮件。
我不是 prestashop 覆盖和编程方面的专家,所以我尝试像这样覆盖 mail.php class:
<?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;
}
?>
我不知道它是否正确,但在制造混乱之前我需要任何帮助:)
谢谢
我以这个可行的解决方案结束。 我 post 这里的代码所以如果有人需要这种方式工作:
<?php
/*
MODIFIED VERSION TO SUPPORT TRUSTPILOT SEND ON SHIPPED STATUS CHANGE
*/
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)
{
if($template == 'shipped') { $bcc = array('xxxx@invite.trustpilot.com'); }
return 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);
}
}
现在我只有一个问题:shipped.html 没有 {mail} 占位符。我如何覆盖 AdminOrdersController.php 以允许我在邮件模板中添加新的 {mail} 占位符?
太