Skip to main content

Dynamic JSON content

Dynamic JSON content is good way to create dynamic messages and automate your work. It allows you to add information, generated exactly at the moment messages are sent.

You can include variables into JSON content queries, for example profile data fields like {lead._fname}.

Set the source of your external JSON content in message options tab.

JSON data looks like this:

{
"number": 10,
"text": "Hello!",
"list": ["One", "Two", "Three"],
"object": {"model": "x17", "price": "$99"},
"mixed": [
{"city": "Los Gamburger", "street": "Florence Avenue"},
{"city": "St. Potato", "street": "Glendale Boulevard"}
]
}

To add dynamic JSON content to your message template click the green </> variables button and select External JSON.

Thus JSON content is inserted into a message as a special variable type*{json.variable}:

Two data types: "list" and "object" are available**.**

  • Objects are inserted as a one-value variable, like this: {json.object.key_name}

  • Lists are JSON arrays — they can be inserted with the help of loops, like this one:

{for $index $products= json.products} 
<li>{$products}</li>
{else}
<p>Check for new products next week!</p>
{end}