Liquid syntax in email code editor
Hi I am trying to put a conditional statement in an HTML email template with the code editor, like
{% if payload.socials != "" %}
<tr>
<td colspan="2" valign="middle" id="social">
{{payload.socials}}
</td>
</tr>
{% endif %}
However, that throws a syntax error on the 'if' statement.
How can I check if my payload.socials parameter is not empty?
NB I can check for {% if payload.socials %} but that is true even if payload.socials is "".
And if I do not provide a payload.socials, then I get an error that my trigger message does not match the payload scheme (obviously).
2 Replies
@Casper
Checkout this code. You need to use apostrophes in place of double quotation marks
Thanks I will try that. Also will try non-required fields.