Repeat a block of items in your emails

💡 Good to know
Our Dynamic list option is now called Repeat block and is available in both Drag & Drop editors.

In this article, we will explain how to use the Repeat block feature to insert a single block of items that will automatically repeat itself and iterate over all items within a single variable.

You can repeat a block in:

  • an email receipt email to display all the items your client has purchased,
  • an abandoned cart email to display all the items that were left in your client's cart,
  • an RSS campaign to automatically display a series of blog articles,
  • etc.

Before you start

What is the Repeat block feature?

To repeat a block, you have two options:

Thanks to the Repeat block feature, you can add lists of items within a single block in your emails. For example, you can send an abandoned cart email with the list of items left in your client's cart or an order confirmation with all the items your client just bought.

The Repeat block feature works as follows:

  1. You insert transactional parameters placeholders in an email template, e.g. {{ item.name }} and {{ item.price }}.
  2. The transactional parameters are retrieved through an API call or through an Automation workflow triggered by an event.
  3. The placeholders are dynamically populated with information specific to each recipient during the sending of the transactional email. The pattern will be repeated for as many items as you'd like, and the number of items displayed will adapt in each email.

Here is an example of what a repeatable block looks like in the Drag & Drop Editor (Classic) and what it can look like once populated with the data of a recipient who purchased 4 items: 

mceclip7.png mceclip0.png

Step 1: Insert your transactional parameters placeholders

You first need to decide what transactional parameters placeholders you want to add to your email. It can be the name and price of products purchased by your clients, the shipping costs, etc.

To insert your transactional parameters placeholders in your email template:

  1. Drag and drop a Text block into your email template.
  2. Within the body of the text, type in the transactional parameters placeholders that corresponds to the information that you want to mention in your email (name, price, variant, etc.).
    Note: Find the list of predefined transactional parameters placeholders to use in your emails in Customize your emails using transactional parameters.
    mceclip6.png

💡 Good to know
In the New Drag & Drop Editor the placeholders will be replaced by red tags in the email template.

Step 2: Repeat a block

The procedure is different according to the editor you're using. Repeat a block:

Using the Drag & Drop Editor (Classic)

mceclip1.png

Using the New Drag & Drop Editor

mceclip0.png

Using the Drag & Drop Editor (Classic)

Enable the Repeat block feature

To enable the Repeat block feature in your email template:

  1. Once you have added your placeholders, click the pencil icon to edit the settings of the Text block.
  2. Enable the Repeat block feature from the menu on the right.
    mceclip8.png

Fill in the parameter and variable fields

Below the Repeat block feature, in the Variable names and What parameter contains the concerned attributes? fields, enter the following information:

  • variable: the first word in your placeholder, e.g. for the section containing {{ item.name }} the variable is item. If you have connected your website to Sendinblue using one of our plugins, the variable is item by default.
  • parameter: the plural version of your variable, e.g. for the section containing the placeholder {{ item.name }} the parameter is items. If you have connected your website to Sendinblue using one of our plugins, the parameter is items by default.

mceclip9.png

If you are not using a Sendinblue plugin or if you are using other transactional parameters, you can find this information in your event logs. Learn how to find this data in our article Customize your emails using transactional parameters.

Set a limit of items

If necessary, you can choose to limit the number of items displayed in the emails sent. To do so, input the number of maximum items you want to display in the Limit field.

mceclip10.png

Save your template

In the Drag & Drop Editor (Classic), content blocks that contain dynamic content, such as a repeated block or display conditions, are marked with a code symbol </> in the top-left corner of the block.

mceclip4.png

When saving your email template, the icon will turn red if a dynamic option is enabled but is missing required information. To correct it, simply complete the empty fields and save your email template again.

mceclip11.png

Using the New Drag & Drop Editor

Enable the Repeat block feature

To enable the Repeat block feature in your email template:

  1. Once you have added your placeholders, hover over the block you want to repeat.
  2. Click the Repeat block icon.
    mceclip12.png

Fill in the repeatable block information

mceclip6.png

In the Repeat block popup window, enter the following information:

  • In the Repeat for field, input the plural version of the first word of your placeholder, e.g. for the section containing the placeholder {{ item.name }} enter items. If you have connected your website to Sendinblue using one of our plugins, the name is items by default.
  • In the Variable alias field, input the first word in your placeholder, e.g. for the section containing {{ item.name }} the variable is item. If you have connected your website to Sendinblue using one of our plugins, the name is item by default.

If you are not using a Sendinblue plugin or if you are using other transactional parameters, you can find this information in your event logs. Learn how to find this data in our article Customize your emails using transactional parameters.

Set a limit of items

If necessary, you can choose to limit the number of items displayed in the emails sent. To do so, input the number of maximum items you want to display in the Limit field.

mceclip5.png

⏩ What's next?