Conditional logic based on field values?

Pat Friedl

Member
Hey all,
I'm wiring up a survey on a sales page which is also the signup form for my list. This allows me to create a highly segmented list.

One field is gender, and I'd like to send a welcome email or autoresponder day 0 email to the user and include a download link. However, I want the link based on gender so that men will get one link and women another. Is this possible in MW, or how would you set that up?

Also, do the field names in the form have to be all cap, or will MW pull them in regardless of case?
 

twisted1919

Administrator
Staff member
Yes you can do it, by enabling the template engine from /backend/index.php/settings/campaigns/template-engine.
This will enable twig, see docs here, so you will be able to do things like:
Code:
{% if GENDER == 'male' %}
    <a href="">Link for M </a>
{% elseif GENDER == 'female' %}
    <a href="">Link for W </a>
{% endif %}

Also, do the field names in the form have to be all cap, or will MW pull them in regardless of case?
They need to be uppercased.
 

Pat Friedl

Member
Sweet, glad I can do that, as that keeps me from having to keep two separate lists! Ok, the twig docs are good, but in order to use it in the email template, do you actually paste the markup just like show into the source code of the outbound campaign content?
 
Top