Search code examples
mautic

How to load contact field token in email template based on condition


I want to show the contact first name in the e-mail, but if the first name field is empty I want to show some other field. Is this possible? Something like this:

Hi {contactfield=firstname} or if empty {contactfield=email}

Thank you in advance.


Solution

  • Yes it is possible, you can use "Dynamic Content" option available in slot type. it allows you to use variations in the content based on value of the the field.

    simply add the slot, then put in a default value, click Add Variant and at the bottom right you can choose the field and comparison option.

    enter image description here