Prestashop 1.6 - 在订单确认电子邮件

时间:2016-04-14 01:19:26

标签: prestashop-1.6

我在一些Prestashop论坛和Stackoverflow上搜索,但似乎我无法找到该问题的答案:

- 订单确认邮件后,是否可以向客户发送第二封电子邮件(基于自定义邮件模板)?

客户正在购买产品,付款,通过电子邮件接收订单确认,然后会向他发送其他电子邮件,说明自定义消息。

我已经查看了电子邮件提醒模块,但它看起来并不意味着这样做。

我在Prestashop v1.6上

非常感谢你的帮助和时间。

2 个答案:

答案 0 :(得分:1)

您可以通过覆盖PaymentModule类来实现此目的。

订单确认邮件是从validateOrder()类的PaymentModule函数内的代码发送的。您只需添加代码即可在订单确认邮件代码后发送第二封电子邮件(自定义电子邮件)。

以下代码负责发送订单确认邮件。

Mail::Send(
       (int)$order->id_lang,
       'order_conf',
       Mail::l('Order confirmation', (int)$order->id_lang),
       $data,
       $this->context->customer->email,
       $this->context->customer->firstname.' '.$this->context->customer->lastname,
       null,
       null,
       $file_attachement,
       null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);

答案 1 :(得分:0)

除了Raghubendra Singh的回答。不确定这是最好的方法。

您可以通过覆盖PaymentModule课程来实现这一目标(参见Mail::Send();

要创建自定义电子邮件子流,您必须修改:

app/Resources/translations/fr-FR/EmailsSubject.fr-FR.xlf

添加主题:

<trans-unit id="fca7e8d1c86db11246e429e40aa10c82" approved="yes">
        <source>Your new subject</source>
        <target xml:lang="fr">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</target>
        <note>Context:
File: classes/PaymentModule.php:844</note>
 </trans-unit>

您还可以创建新的电子邮件模板: 在这里添加你的文件: (您可以复制粘贴其中一个模板并根据需要进行修改)

mail/fr/new-template.html
mail/fr/new-template.txt
相关问题