【问题标题】:Adding a condition to modify email content within the same email template in Magento在 Magento 的同一电子邮件模板中添加条件以修改电子邮件内容
【发布时间】:2015-01-22 10:06:20
【问题描述】:

我需要为 paypal 付款的“待付款”和“已取消”发送相同的电子邮件模板,除非我通知客户他们有待付款强>应该说Your order is in pending payment。如果我在管理员中点击取消按钮,邮件内容应该是unfortunately your order has been cancelled

我已经在我的邮件模板中尝试过这个:

{{if order.getStatusLabel() == 'canceled'}}
 <p>unfortunately your order has been cancelled</p>
{{else}}<p>Your order is in pending payment</p>
{{/if}}

unfortunately your order has been cancelled 已发送两种订单状态。

  1. 我的 if 条件 似乎不起作用。任何想法为什么不呢?
  2. 订单状态有时会返回已取消,有时会返回已取消。我不确定为什么不一致!

【问题讨论】:

    标签: php email magento


    【解决方案1】:

    您不能在电子邮件模板中使用逻辑运算符。相反,您可以做的是使用自定义方法扩展销售订单模型,该方法返回一个适用于您的布尔值,然后在没有逻辑运算符的情况下调用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 2017-11-01
      • 1970-01-01
      • 2019-06-02
      相关资源
      最近更新 更多