Using your data to provide Dynamic Content

How to Use Fields for Dynamic Content

Dynamic variables are a great way to personalize your message with information you've collected in your DataMart about the user (Name, Address, Recent Purchases, etc.). 

This will help you engage your customers on a much more personal level.


1.  The ## Tag

TheTag.png


2.  Field Names

 

ManageDataFields.png

 

To view the available fields in your DataMart and the Field Name that needs to be referenced in your message, follow these steps:

 

  1. Click on the Target Tab
  2. Click on the Datamart Fields Button
  3. The fields names are located under the Name header.

How to Create a Dynamic Subject Line

This feature offers the possibility to create Dynamic Subject Line based on the data that was collected from your customers or users, You can either use a dynamic variable or add a logic.


1.  Click ## "Insert a Dynamic Variable" button

        Go to Compose > Envelope 

InsertDynamicVariable.png

 

 


2.  Select your Fields

 

InsertDynamicVariable.png

 

In the popup window, different options are available

  1. Select a field : You can choose which DataMart field you would like to pull and display dynamically.
  2. Select a format : This allows you to reformat the data (eg. Switching All caps into lower case)
  3. Default value : If the data field was not provided or collected, we can choose to display a default value eg. "Customer"
  4. Click Insert

3.  Click on Add Logic

 

AddLogicButton.png

 


4.  Add Logic Explained

 

AddLogicExplained.png

 

In the popup window, different options are available

  1. The IF statement is the first condition based on the DataMart fields.
  2. The ELSE/IF statement is the following condition based on the DataMart fields.
  3. The ELSE statement will display the value added in the text box if the above conditions are false
  4. Click Insert

5.  Logic Example

 

AddLogicExample.png

 

How to Provide Targeted Information using Dynamic Content

When building a message or template, you might come across a situation where you want to display an offer or image to the recipient based on their preferences or the demographic information you have collected on them. 

Dynamic Content allows you to create IF/ELSE statements to help dictate which recipients will receive which pieces of content in the message.


1.  Place the cursor where you'd like the dynamic content to appear OR select the content you'd like to replace with Dynamic Content statement.

 

Place the cursor where you'd like the dynamic content to appear OR select the content you'd like to replace with Dynamic Content statement.

 


2.  Click the "Dynamic Content" button in the Editor Bar

 

Click the

 


3.  Name the Dynamic Content section

 

Name the Dynamic Content section

 

 


4.  Define the "IF" statement or copy logic from an existing Dynamic Content piece

 

Define the

 

 


5.  Select the Content Type

 

Select the content type

 

The different content types are:


6.  OPTIONAL: Define additional "ELSE IF" statements

 

OPTIONAL: Define additional

 


7.  If required, define content for the "ELSE" statement

 

If required, define content for the

 

 


8.  Finally, click "Insert" to place the variable in the message or template

 

Finally, click

 


9.  The Dynamic Content variable will appear in the template highlighted green

 

The Dynamic Content variable will appear in the template highlighted green

 

Leveraging Data Extensions in your email content

Personalize your emails even further by inserting the information in your Data extension. This can be used for displaying preferred location information or the customer's assigned customer rep. This can create a more one-to-one experience - the type that converts.

Tutorial

Please note: To try out the feature, click the full screen icon Qx1Screenshot-2023-10-26-141632.png in the tutorial.

 

Dynamic Content Syntax

PREREQUISITE : Dynamic Content

Allows the user to create dynamic content statements without needing to know the syntax. 

A new syntax has been created in the system which allows developers to keep all content and logic within one document.


Syntax


Data Types for Format


Dynamic Content Syntax.

 

HTML
###variablename###
 if (field[FieldName] operator "value" ) { "Content" }
else if (field[FieldName] operator "value" ) { "Content" }
 else { "Content" }
###/variablename###

Logic Breakdown (Part 1)

 

HTML
if (field[FieldName] operator "value" ) 

 


Logic Breakdown (Part 2)

 

Email/Text Operators:

equals, is_not, begins_with, contains, not_contain, is_empty, not_empty 

 

Number/Date Operators:

HTML
==, !=, greater, greater_or_equal, less, less_or_equal, is_empty, not_empty 

 

AND/OR Statements:

HTML
if ((field[ ] ) && (field[ ] )) 

 

HTML
if ((field[ ] ) || (field[ ] ))

 

HTML
if (((field[ ] ) && (field[ ] )) || (field[ ] ))

 

For Each Statements:

Use the for.each statement by itself:

HTML
for.each({"test data"})
for.each({block "<table><tr><td>Some text</td></tr></table>"})
for.each({image: "<img src="http://imagefile.jpg">"})

Or combined with an IF statement:

HTML
if(condition) {block "for.each({"test data"})"}
if(condition) {block "for.each({block "<table><tr><td>Some text</td></tr></table>"})"}
if(condition) {block "for.each({image: "<img src="http://imagefile.jpg">"})"}

 

Content Types

Text: Should only contain text, no HTML.

Example:

HTML
{ "Here is some text" }

Image: Should only contain an image tag.

Example:

HTML
{ image"<img src="http://imagefile.jpg">" }

Block: Can contain anything including code.

Example :

HTML
{ block"<table><tr><td>Some text</td></tr></table>" }

Web and Text Versions

Web versions

 

HTML
if (content[type] == "email" ) or if (content[type] == "webversion")

 

Text Versions

System Variables

These variables provide data from the system for various use cases. They all begin with "system" and are proceeded by the variable name.

Eg. ##system:deploymentid##

Variable Description
deploymentid Provides the ID of the deployment at the time of send and is great for adding context to other tracking code.