Example with Data Feed
The platform allows you to include data from external sources (data tables, content libraries, RSS feeds, and Apps) in your newsletter design.
The following example uses the Dynamic feed >> app to display a product catalog in the newsletter.
To display this data, use the following syntax:
[temp:item.NOMECAMPO]
For example, suppose you have a data table named CATALOGO containing information such as: product name (title), description (description), price (price), image (image), and the product link (link ).
In the communication we want to display four products as follows:
In the design
For each content item to display, use the following syntax:
[temp:item.title] --> Prints the product name
[temp:item.price maxdigits="2" mindigits="0" locale="it"] € --> Prints the product price
[temp:item.image{[image:content.png]}] --> prints the product image
[temp:item.link] --> prints the product URL on your website.
Example with variables defined in the template
-
Define the variables. Go to the communication code, Advanced body-start, and paste the following code:
<meta mn:tempvar mn:name="str_importo_pre" mn:value="'di <strong> '" mn:type="string"> <meta mn:tempvar mn:name="str_importo_post" mn:value="' €</strong>'" mn:type="string"> -
Reference the variables in the HTML view of the text element
Le confermiamo che il totale dei suoi ordini è [temp:str_importo_pre] [contact:PURCHASESTOTALVALUE grouping=true groupingseparator='.' decimalseparator=',' maxdigits='2' mindigits='2'] [temp:str_importo_post]
Example with workflow variables
In workflows you can define temporary variables, populate them through a workflow node, and print them in the message.
Example: the contact enters the workflow to use a voucher; the voucher expires exactly 30 days after the first message is sent, which in this case is the day the contact entered the workflow.
- Define a workflow variable that identifies the workflow expiration date
In the workflow settings, under the Advanced section, define the variable - Use the "Update variable" node to populate "Voucher Expiration Date" using the
fn.dateadd()function Learn more about functions >> - Now we can use the data_scadenza_buono variable both in text and conditions to verify whether the voucher has expired; the syntax is
[workflow:data_scadenza_buono]; in conditions you can use:(workflow.values.data_scadenza_buono lte 'XXXXXX')