Send data arrays in Automation 360

To send an array of data to the customer, for instance, as a reminder about an abandoned cart or an offer to check out some products similar to those the client was looking at, use the "Structure" variable type.

Open "Email" - "Automations" - "Events manager", and add a new custom event or edit an existing event.

Add a "Structure" variable.

Set up structured variables and click "Add."

Structured variables can transfer links with items' images.

This is how a data array (structure) of variables will look like in the email message editor:

Use the HTML editor to insert images of the items: hit the "Insert/edit image" button, insert a variable into the "Source" box. The variable will transfer the image link.

Besides, there is another option to insert an image. Open the template editor and click on the blue arrow to open the bottom part of the text editor:

Then click the "Source code" icon:

The source code editor will open. Insert <img src="{{item.string}}"/>, where {{item.string}} is a variable, that will transfer  the image link:

This way you can insert an image, that was, for instance, transferred by the result of subscriber's actions with the campaign: select "Change variable" as the action type, select the proper variable for the email list and add its value — image link.

Variables from a mailing list can be used in the array if the mailing list is linked to the start of the automation flow.  
Other variables from the event can be used as well.

A variable name must start with a Latin letter and consist of numerals and Latin characters only. Intervals and special characters can't be used in variables' names. 

Hyperlinks can't be transferred via structured variables.

To start the automation flow, send the event to the URL you get after the event creation.

The images won't be displayed when you save the template, but the recipient of the triggered email will see them.

How to add data arrays into a table

Data arrays can be added in a table in an email template with the help of the HTML editor or template designer.

HTML editor

Select an event with variables of structure type as the flow start.

Link the "Email" block to the flow start. In the settings panel of the "Email" block open the HTML editor.

Insert the variables from the event on which the flow starts into the email content.

Edit the source code.

Write the table parameters in the HTML code of the email.

Add the [CDATA []] tag for each data array in the HTML editor.

Sample code with one data array:

<table style = "width: 100%;">
<tbody> <! [CDATA [| [for item in Product_1] |]]>
<tr>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> <img src =" {{item.product_name}} "caption =" false "> </ td>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> {{item.item_number}} </ td>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> {{item.price}} </ td>
</ tr>
<! [CDATA [| [endfor] |]]> </ tbody&gt
</ table>

An email template after adding a table layout to the source code:

Designer

Select an event with variables of structure type as the flow start.

Link the "Email" block to the flow start. In the settings panel of the "Email" block start the designer.

Choose the structure that suits you.

Insert variables from the event on which the flow starts into the text block of the template.

Edit the source code.

Write the table parameters in the HTML code of the email.

Sample code with one data array:

<table style = "width: 100%;">
<tbody>
<tr>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> {{item.product_name}} </ td>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> {{item.item_number}} </ td>
<td style = "max-width: 170px; color: # 555555; font-family: 'PT Sans Narrow', sans-serif; font-weight: bold; text-transform: uppercase; padding-bottom: 10px; padding- top: 10px; padding-right: 15px; width: 7.80952%; "> {{item.price}} </ td>
</ tr>
</ tbody>
</ table>

An email template after adding a table layout to the source code:

Rate this article about "Send data arrays in Automation 360"

User Rating: 5 / 5 (7)

    Other useful articles

    Popular in Our Blog

    Try SendPulse today for free