Using Conditional Display - Part 3: Dynamic Lists

❗️ Important
At the moment this feature is only available for the Drag & Drop editor (Classic). It will be available soon for the Drag and Drop Editor (New).

In this third article, we will explain how to use conditional display in the Drag & Drop Editor (Classic) based on dynamic lists. When using the dynamic list option for a design block in your email campaign or template, you may choose to display this block when conditions within the dynamic list are met. 

This is very useful when you only want to display a list if the list contains your desirable elements.

Conditional display based on dynamic lists

As an e-commerce vendor, we want to send an email confirming when items in an order have shipped that includes the option to separately list any items on back order:

sample_email.png 

To create the above email:

  1. In a first block, insert a dynamic list for the shipped products
  2. Select this block and enable Conditional display
  3. In the first drop-down list, select Dynamic list variable
  4. In the Key field, enter the name of the key you want to display the block based on. In our example, we have entered a key called "shipped". When the template detects a "yes" value for this key, it will display the block list with all shipped products.
    Cond-display-dyanmic-list-var_true.png
  5. In a second block, insert the same dynamic list for the products that will be shipped later
  6. Select this block and enable Conditional display
  7. In the first drop-down list, select Dynamic list variable
  8. In the Key field, enter the name of the key you want to display the block based on. In our example, we have entered the same key called "shipped". When the template detects a "no" value, it will display the block list with all products that will ship later. 

Cond-display-dyanmic-list-var_false.png

💡 Good to know
This option is powered by the IF and FOR tags available in the New Template Language. To learn more about this functionality, check out this overview guide

If you are unfamiliar with the elements in a FOR tag, this color-coded reference may help you correctly place each element in your email campaign or template:

terms.png

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

Saving your email

Email design blocks that contain dynamic content, such as dynamic lists or conditional display, are marked with a code symbol in the top-left corner of the block.

SendinBlue_Responsive_Template_Builder.png

When saving your email campaign or template, the icon will turn red if a dynamic content option is enabled but is missing required information.

To correct it, simply complete the empty fields and save again.

SendinBlue_Responsive_Template_Builder_error.png

🤔 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.