【问题标题】:Prestashop 1.6 - Send a second email to the customer after order confirmation emailPrestashop 1.6 - 在订单确认电子邮件后向客户发送第二封电子邮件
【发布时间】:2017-06-05 06:22:00
【问题描述】:

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

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

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

我已经查看了电子邮件警报模块,但它看起来并不打算这样做。

我在 Prestashop v1.6 上

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

【问题讨论】:

  • 你有任何编程技巧吗?您必须为此创建一个自定义模块。
  • 我对 prestashop 有点陌生!我会尝试 Singh 的建议。 :)

标签: prestashop-1.6


【解决方案1】:

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

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

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

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
);

【讨论】:

    【解决方案2】:

    除了 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-03
      • 1970-01-01
      • 2017-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多