Is MJML If statement with an OR operator possible?

Viewed 1486

I am having trouble adding an extra conditional in my mjml if statement. Is there an OR operator in mjml? Can't seem to find it even in their docs.

I tried using || and | but get errors when throwing the html into mailjet.

Here is what I have tried:

 
      <mj-raw>{% if var:variable:"" != "" | var:variable:"" != "$0"%}</mj-raw>
      <mj-section padding="0 0 16px 0">
        <mj-group>
          <mj-column>
            <mj-text>
              <p class="left-aligned-line-item">Text</p>
            </mj-text>
          </mj-column>
          <mj-column>
            <mj-text>
              <p class="right-aligned-val header-bold">{{ var:variable:"" }}</p>
            </mj-text>
          </mj-column>
        </mj-group>
      </mj-section>
      <mj-raw>{% endif %}</mj-raw>
1 Answers

I found that nesting if statements works. It's a bit clunky, but this is the working solution at the moment.

      <mj-raw>{% if var:variable:"" != "" %}</mj-raw>
      <mj-raw>{% if var:variable:"" != "$0"%}</mj-raw>
      <mj-section padding="0 0 16px 0">
        <mj-group>
          <mj-column>
            <mj-text>
              <p class="left-aligned-line-item">Text</p>
            </mj-text>
          </mj-column>
          <mj-column>
            <mj-text>
              <p class="right-aligned-val header-bold">{{ var:variable:"" }}</p>
            </mj-text>
          </mj-column>
        </mj-group>
      </mj-section>
      <mj-raw>{% endif %}</mj-raw>
      <mj-raw>{% endif %}</mj-raw>
Related