Show or hide content based on repeatable content

šŸ’” Good to know
Our Repeat blockĀ option is now calledĀ Repeatable content. The Repeatable content option can be used only on Sections.

Brevo allows you to design email templates and campaigns that display unique content elements to different recipients depending on the conditions you set.

We have divided this topic into 3 articles. In this first article, we will explain how to show or hide content based on repeatable content.

Before you start

Display specific content to different recipients based on repeatable content

Content visibility based on repeatable content allows you to display a specific content (image, title, text, section etc.) based on the conditions you set for a repeatable content.

When using the Repeatable content option in an email campaign or template, you may choose to display content when conditions within the section are met. This is very useful when you only want to display a repeatable content only if it contains your desirable elements.

Let's imagine that we want to create an email confirming when items in an order have shipped that includes the option to separately list any items on back order. This email would contain:

  • A list with the items that were shipped
  • A list with the items that are back ordered and will be shipped later

sample_email.pngĀ 

Personalize your email based on repeatable content

To create the above email:

  1. In a first section, use the Repeatable contentĀ feature for the shipped products.
  2. Select the section you want to show only to recipients whose order has been shipped. Then, from the side panel, open the Content visibility section and click + Add condition.
    enable-block-visibility_EN-US.png
  3. In the Add display conditions popup, choose the conditions in which the section should display:
    1. For our example, we want to show the section if all the conditions below are set to "true".
    2. The content visibility is based on transactional params. In the Key field, enter the name of the key you want to display the section based on, here "shipped". When the template detects a "yes" value for this key, it will display the section list with all shipped products. The transactional parameter type is boolean and it should equal Yes to display the section.Ā 
    3. Click Add condition.
      block-visibility-transac_EN-US.png
  4. In a second section, use the Repeatable contentĀ feature for the back ordered products that will be shipped later.
  5. Select the section you want to show only to recipients whose order has not been shipped. Then, from the side panel, open the Content visibility section and click + Add condition.
    block-visibility-shipped-later_EN-US.png
  6. In the Add display conditions popup, choose the conditions in which the section should display:
    1. For our example, we want to show the section if all the conditions below are set to "true".
    2. The content visibility is based on transactional params. In the Key field, enter the name of the key you want to display the section based on, here "shipped". When the template detects a "no" value for this key, it will display the section list with all back ordered products that will be shipped later. The transactional parameter type is boolean and it should equal No to display the section.Ā 
    3. Click Add condition.
      block-visibility-no-boolean_EN-US.png

Congratulations! šŸŽ‰ You have applied display conditions. When conditions are inserted, the section border turns green and features a slashed eye icon. Click it if you need to edit your condition.

To create the example email showed above, we pasted the following in our API v3 call to send a transactional email:

cond-display-dynamic-list-var_call-example.png

ā© What's next?

šŸ¤” Have a question?

If you have a question, feel free to contact our support team by creating a ticket from your account. If you don't have an account yet, you can contact us here.

If youā€™re looking for help with a project using Brevo, we can match you with the right certified Brevo expert partner.

šŸ’¬ Was this article helpful?

1 out of 7 found this helpful