首页 > 解决方案 > 液体脚本支持

问题描述

我正在尝试运行一个液体脚本,但它似乎根本不起作用。该脚本会检测收到的电子邮件中是否抄送了地址,然后启动模板。

我的脚本看起来像这样

{% assign templates = "" %}

{% for cc in ticket.ccs %}
  {% if cc.email == "EMAIL 1" %}
    {% assign templates = templates | append: "template-ID," %}
  {% endif %}  
  {% if cc.email == "EMAIL_2" %}
    {% assign templates = templates | append: "template-ID2," %}
  {% endif %}
{% endfor %}

{% if templates != "" %}
  {{ templates }}
{% else %}
  Test
{% endif %}

这个想法是,如果我收到一封发往任何地址的电子邮件,并且电子邮件 1 或电子邮件 2 是抄送的,我想为任何抄送地址自动启动我的模板。

我尝试使用一个简单地更改电子邮件标题的模板。经过我所有的测试,标题从未改变。在我看来,要么没有检测到 cc,要么模板没有启动。

有人有想法吗?

标签: emailliquid

解决方案


推荐阅读