On this page
Use dynamic content
Show different HTML blocks to different subscribers in one campaign, based on their data or past activity.
Dynamic content is an advanced, HTML-based feature. You'll work in the HTML editor's source-code mode and write a little markup. If you're not comfortable with HTML, display conditions offer a simpler, visual alternative.
Dynamic content shows different blocks to different people inside a single campaign - product recommendations, location-based offers, behavioural triggers - without building separate emails. You define conditional blocks that change based on subscriber data or past campaign activity.
How it's written
All dynamic-content instructions go inside square brackets; anything outside them is sent as-is. A basic conditional looks like this:
[IF variable operator constant]
<HTML to show>
[ELSEIF variable operator constant]
<HTML to show instead>
[ELSE]
<HTML to show if nothing matched>
[ENDIF]
Variables, operators and constants
Variables are what you test - list fields (wrapped in backticks) or previous campaign activity. Supported data types are boolean, integer (-8,388,608 to 8,388,608), string (up to 255 characters) and date (in YYYY-MM-DD HH:MM:SS, 24-hour clock).
Campaign activity lets you react to what a subscriber did: MAILING(id) refers to a campaign and LINK(id) to a link, with statuses OPENED and CLICKED. You'll find a campaign's ID at the end of its stats URL, and a link's ID after link= in the click-report URL.
Operators:
- Text:
LIKE,NOT LIKE - Numbers and dates:
=,!=,<,<=,>,>= - Activity:
IS,IS NOT - Combining:
AND,OR
Constants go in double quotes for text, date or integer values, like "NY", "2010-08-02 10:00:00" or "5".
Example expressions
`email` LIKE "%hotmail%" -> address contains "hotmail"
`id` > "1000" -> list ID over 1000
MAILING(34342) IS OPENED -> opened campaign 34342
(`email` LIKE "%hotmail%") AND (MAILING(34342) IS OPENED)
The variable and constant must be the same data type, and you can group expressions with parentheses.
Functions
MOD(N,M) returns the remainder of N divided by M - handy for picking a fraction of your list:
[IF MOD(`id`,10) = 5]
<p>You are a winner!</p>
[ELSE]
<p>Sorry! Try again!</p>
[ENDIF]
Troubleshooting
It shows as plain code - make sure everything is inside brackets, you're in HTML/source mode, and every [IF] has a matching [ENDIF].
Conditions don't evaluate - variable names must match field names exactly (case-sensitive) and be wrapped in backticks, and data types must match (don't compare text to numbers).
ELSEIF/ELSE don't work - keep the order IF, ELSEIF, ELSE, ENDIF, and check each block is valid HTML.
Complex expressions fail - build up gradually, use parentheses to group, and check spacing around operators.
If dynamic content won't behave, open a support ticket.