如果条件在mjml版本3.3.5中不起作用

时间:2018-07-03 07:10:24

标签: node.js if-statement mjml

这是我的测试代码,用于判断条件是否不适用于mjml 3.3.5版本。

<mjml>
  <mj-body>
    <mj-image width="100px" src="/assets/img/logo-small.png"></mj-image>
    <mj-divider border-color="#F45E43"></mj-divider>
    <mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
    {%if "a" == "a"  %}
        This is a text    
    {% endif %} 
            </mj-body>
</mjml>

1 个答案:

答案 0 :(得分:0)

您应该将数据原始放置并尝试

<mjml>
  <mj-body>
    <mj-raw>{% if "a" == "a" %}</mj-raw>
    <mj-section>
      <mj-column>
        <mj-text>{{data}}</mj-text>
      </mj-column>
    </mj-section>
    <mj-raw>{% endif %}</mj-raw>
  </mj-body>
</mjml>