Details
Conditional Wildcards allow you to change parts of an email based on certain data (or conditions) against your contacts. For example, if you know what country your contacts live in, you could change parts of an email (ie. text or images) based on their location.
Our platform allows you to add conditional elements several ways:
- Via code in your HTML-code email designs (which you can import into our platform)
- Via code view in certain components (such as a Text or Paragraph component) using our drag & drop email editor
- Via the main user interface in our drag & drop email editor.
In this guide, we'll be looking at the first and second options.
If you are looking to add conditions onto parts of an email (or 'components', as we call them) via our Drag & Drop editor's main user interface, please see Conditional Content in an Email.
When using conditional content, there is a cap of 75 conditional content checks per email.
Wildcard Fallbacks
Our wildcards also feature a "fallback" option, which is displayed when the field for a particular contact is empty.
The fallback text is configured as follows:
%%wildcard**Fallback text here%%
For example, if you wanted to introduce an email and you had a field called 'First_Name' but you want to display the word 'customer' if the first name field has no value, then you would configure the wildcard as follows:
Dear %%First_Name**customer%%
For contacts with an empty 'First_Name' field, the message would show as:
Dear customer
Conditional Wildcards
- Value exists: HAS
- Value does not exist: HASNOT
- String value contains: CONTAINS
- String value doesn't contain: NOTCONTAINS
- Value is exact match: EXACTLY
- Value is not exact match: NOTEXACTLY
- Value is greater than: GREATERTHAN
- Value is greater than or equal: GREATERTHANEQUAL
- Value is less than: LESSTHAN
- Value is less than or equal: LESSTHANEQUAL
- Value is included in comma delimited string values: INCLUDES
- All comma delimited string values are included in comma delimited string values: INCLUDESALL
- Value is not included in comma delimited string values: NOTINCLUDES
- No comma delimited string values are included in comma delimited string values: NOTINCLUDESALL
- ELSE operations can be used with any conditional statement (as shown in some examples below)
Examples
%%FieldA:HAS%%
The list has a field called "FieldA" and the contact's value is not blank.
%%FieldA:ELSE%%
The field does not exist, or contains a blank value
%%FieldA:END%%
%%FieldA:EXACTLY:Business%%
The database has a field called "FieldA" and the contact's value is equal to "Business"
%%FieldA:END%%
%%FieldA:CONTAINS:Business%%
The database has a field called "FieldA" and the contact's value contains the string "Business"
%%FieldA:END%%
%%FieldA:GREATERTHAN:1%%
The database has a field called "FieldA" and the contact's value is greater than 1
%%FieldA:END%%
%%FieldA:EXACTLY:Business:OR:FieldB:EXACTLY:Business%%
The database has a field called "FieldA" and the contact's value is equal to "Business",
OR the database has a field called "FieldB" and the contact's value is equal to "Business"
%%FieldA:end%%
%%FieldA:EXACTLY:Business:AND:FieldB:EXACTLY:Business%%
The database has a field called "FieldA" and the contact's value is equal to "Business",
AND the database has a field called "FieldB" and the contact's value is equal to "Business"
%%FieldA:end%%
%%FieldA:EXACTLY:Business:OR:FieldB:EXACTLY:Business:AND:FieldC:EXACTLY:Business%%
The database has a field called "FieldA" and the contact's value is equal to "Business",
OR the database has a field called "FieldB" and the contact's value is equal to "Business",
AND the database has a field called "FieldC" and the contact's value is equal to "Business" as well.
%%FieldA:end%%
%%FieldA:EXACTLY:Business%%
The database has a field called "FieldA" and the contact's value is equal to "Business"
%%FieldA:ELSEIF:EXACTLY:Commercial%%
The database has a field called "FieldA" and the contact's value is not equal to "Business", but is equal to "Commercial"
%%FieldA:ELSEIF:EXACTLY:Residential%%
The database has a field called "FieldA" and the contact's value is not equal to "Business", not equal to "Commercial", but is equal to "Residential"
%%FieldA:ELSE%%
The database has a field called "FieldA" and the contact's value is not equal to "Business", not equal to "Commercial", as well as not equal to "Residential"
%%FieldA:END%%