Skip to main content

Structure Variants and Conditions

This tool allows you to display various versions of structures within a single template based on Merge Tags.

Erik Vlčák avatar
Written by Erik Vlčák
Updated over 2 months ago

Introduction

Structure Variants and Conditions allow you to create various versions of a structure and display or hide them based on simple conditional logic involving the actual value of specified Merge Tags. It’s ideal for personalizing promotions, messages, recommendations, or even layout changes. By utilizing this feature, you no longer need to create multiple versions of the same template; instead, you create one template that adapts and changes its content based on the results of Merge Tags. Whether offering special promotions solely to VIP users or showcasing different product categories by region, variants keep your workflow organized and efficient.

How Variants and Conditions Work

Topol’s Structure Variants and Conditions feature allows you to create smart, dynamic email content that changes based on your recipients' data—using Merge Tags and simple conditional logic (i.e., equals, not equals, exists, larger than, smaller than). Here’s how it works step by step in theory:

1. Create Structure Variants

Start by designing a personalization structure. This feature allows you to create multiple independent variants of that structure, which may contain entirely different content blocks.

Your template can have several structures with variant content, and each structure can include unique conditions to display specific variants.

Example:

  • Variant 1: Welcome image and text for new users

  • Variant 2: Special offer for returning users

  • Variant 3: Loyalty reward message for VIP customers

2. Set Up Conditions

Using Topol’s built-in UI, you can define conditions determining which variant(s) should be displayed.

Each condition includes its name, the Merge Tag to be evaluated, a logic operator, and a specific value used for comparison with the actual value of the Merge Tag. You can not add more logic operators. As this evaluation occurs in the background, Merge Tag(s) used in conditions do not need to be present in the variant or in the template. Merge Tags used for evaluation and Merge Tags used in the template can be completely different.

For example:

  • If *|USER_AGE|* is more than "50", show Variant Senior

  • If *|COUNTRY|* does not equal "Czech Republic", show Variant Foreigner

  • If *|STATUS|* equals "VIP", show Variant VIP

  • Else, show the Variant Default

You can also create a default variant that will be shown if none of the conditions specified for a particular structure are met.

3. Only Relevant Variant is Displayed

When the email is sent through your email service provider, their system retrieves the value of the Merge Tag for each recipient from your database. This value is then evaluated in the condition, and based on the result, a specific variant is displayed in the email, which is then sent to the recipient. This entire evaluation process happens at the moment the email is sent.

This means:

  • You design one email.

  • You create several content paths (variants).

  • Each user sees only the content that applies to them.

Instead of duplicating templates or relying on complex logic in your ESP, you can manage everything directly in our editor.

How to Define a Structure Variant

To create a structure variant, create a structure containing a content block just as usual. With this structure selected, click on the "Variants" button located at the top of Structure options:

A Variants sidebar will open to the right. Here, you can set up conditions for variants of the selected structure. These options include:

  • Variant name: Add a name for this specific variant to distinguish it from others.

  • Conditional Merge Tag: Add the name of the Merge Tag that should be evaluated in the condition.

  • Condition: Select a logical operator from pre-defined options. Pre-defined options include:

    • is = the value of the Merge Tag equals the inserted value.

    • is not = the value of the Merge Tag differs from the inserted value.

    • exists = this Merge Tag contains any value (not compared to the inserted value).

    • greater than = the value of the Merge Tag is greater than the inserted value.

    • less than = the value of the Merge Tag is less than the inserted value.

    • greater than or equal = the value of the Merge Tag is greater than or equal to the inserted value.

    • less than or equal = the value of the Merge Tag is less than or equal to the inserted value.

  • Value to be compared with value of Merge Tag

Once all options for this variant are filled, the setup is complete. You can verify this by hovering over the structure. In the top left part, you should see a pop-up signalizing which variant is currently displayed with an option to add another variant.

You can also add another variant directly in the Variants side panel by clicking on the "Add another variant" button.

This is what the entire process of creating a variant looks like in action:

Consequently, the email will display only the variant of a specific structure for which the condition has been fulfilled. If several conditions have been satisfied, only the most recent variant in the list is applied.

Creating Multiple Variants of the Same Structure

After adding two more variants to this structure, our Variants panel/list looks like this:

We have also enabled the Variant Default by clicking the Eye icon. This variant will be displayed if no other condition in this structure is met.

The variant window can be hidden or expanded by clicking the arrow on the far right next to its name. To remove a variant, click the trash icon. To reorder variants in the list, click and drag the dots up or down. This order is then reflected in the list of variants above the structure:

To change the content of the variant, select it from this list or in the Variants side panel. If you select another variant and nothing changes, do not panic - this is normal, as you have not altered the content for that variant.

With the next variant selected, adjust the content as desired. When finished, choose another variant of this structure and modify it as well. Repeat this process for each subsequent variant. Also, remember to define the Default variant.

After all your variants have been customized, the content of the structure will change depending on the selected variant.

The clip above demonstrates how the design and content of this structure will change based on the value of *|AGE|* Merge Tag.

Conclusion

Remember that you can configure the conditions in any way you choose to achieve a tailored result. For instance, you can establish multiple variants of a structure, each comparing the same Merge Tag to a different value. Feel free to reuse the same Merge Tag across multiple structures; however, keep in mind that if you want to keep variants of multiple structures synchronized, you must manually define the same variants with the same conditions for all of them (there is no option to copy conditions across variants or structures).

If you face any difficulties in setting up variants or need advice for your specific use case, please feel free to contact our support team! 😉

Did this answer your question?