Macro IF statment causes HTML to render as literal string

Kenneth Gilyard asked on May 1, 2020 23:06

The below snippet code in an email template renders the HTML tags in the email that is sent. Other HTML is rendered fine outside of the if statement.

How can I get it to render Raw I guess?

{% if (promoID == 1) { %}
    <p>Dear RECIPIENT_NAME,</p>
    <p>Now is the time to begin preparing for the {% strSpecialsOrderStart %} - {% strPromoName %} by working with your representative</p>
    {% } %}

Correct Answer

Dmitry Bastron answered on May 4, 2020 10:24

Hi Kenneth,

Disabling the encoding should help (it is enabled by default, read more about it here):

{% if (promoID == 1) { %}
    <p>Dear RECIPIENT_NAME,</p>
    <p>Now is the time to begin preparing for the {% strSpecialsOrderStart %} - {% strPromoName %} by working with your representative</p>
{% } |(encode)false %}
1 votesVote for this answer Unmark Correct answer

Recent Answers


Kenneth Gilyard answered on May 4, 2020 20:34

Thank You Dmitry.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.