I am creating a module in which i want to check if my personalization token is empty.
personalization token is {{personalization_token(“contact.firstname”, " ")}} .
If personalization token has value, i want to display " Hello, {{personalization_token(“contact.firstname”, " “)}}”
If the personalization token is empty, i want to display a new html text section.
So far i have this code, would appreciate some help on where i need to modify it for it to work.
{% set Value = personalization_token(“contact.firstname”,“Null”) %}
{% set NewValue = Value %}
{% if NewValue == “Null” %}
<p>
Glad to have you with us!
</p>
Were you able to find a solution? I hqve been trying to use if statement to hide table content when personalization token value is empty. Please let me know, if you were able to find a solution. TIA!
Are you looking/testing it in the preview of the page/email? Because, unless u select proper contact for preview it will be displayed either as CONTACT.FIRSTNAME or “blank”.
Also I would recomend to get the personalition token right by openning an richtext function selecting the right token and copy it from the source code.
Yes that’s where i am choosing contacts.
For this code, i am having HTML displayed whenever i choose any contact (whether the first name has value or not). Just to be clear, i created a module and i am executing this code inside it
{% if contact.firstname !="" %}
HTML
{% else %}
{{ contact.firstname }}
{% endif %}