Skip to content

Conditional Content

This feature is available with the Plugin for Business plan and higher.

If you're on the Plugin for Startup or Plugin Expansion plan, consider upgrading to access this feature. For more details, visit our pricing page or contact support.

Conditional Content in the Topol Plugin allows you to create dynamic variations of email content based on predefined conditions, like personalization for different audiences or A/B testing structures. This powerful feature enables you to manage and edit section variants within the editor, offering a flexible and visual approach to conditional logic.

You can learn more about this feature in our documentation here.

Enabling Conditional Content

To use Conditional Content, you must first enable section variants in your TOPOL_OPTIONS configuration. Add the following option:

ts
enableSectionVariants: true,

This setting unlocks the UI for adding and managing conditional variants of sections directly inside the editor interface.

Adding and Managing Section Variants

  • Add structure variant
Variants
  • Add condition for certain variant
Variants
  • Switch between variants and edit its content
Variants

Conditions play very nice together with Merge Tag Previews.

Conditional Syntax

We currently support conditional syntax compatible with Mailchimp and SparkPost.

We are eager to expand our compatibility with additional providers. If you have a specific provider in mind, please reach out to our support team with your request.

You can choose this syntax setting an emailServiceProvider in Topol Options.

ts
emailServiceProvider: 'mailchimp' | 'sparkpost',

If you set emailServiceProvider: ' sparkpost‘, you will have access to conditional chaining. This allows you to connect multiple conditions for one variant using AND or OR logical operators.

Variants

Merge Tag-Specific Autosuggestions

When configuring Conditional Content, users create rules that decide when a specific variant of a structure appears. Each rule includes a Merge Tag, a custom value, and a logical operator.

To make this process easier and reduce input errors, we allow you to set up autosuggestions for custom values based on each Merge Tag.

Autosuggestions appear in a dropdown when a user selects a specific Merge Tag and either clicks the input field for custom values or starts typing. These suggestions help users choose valid or commonly used options, ensuring consistency and accuracy when creating conditions. However, users can still enter their own custom value if none of the suggested options fit.

You can define autosuggestions directly within a Merge Tag configuration by including the suggestions property with an array of values. Each Merge Tag can have its own dedicated array of suggested values.

ts
{
  value: "*|COUNTRY|*",
  text: "Country",
  label: "Free Shipping Countries",
  // available suggestions for this specific Merge Tag
  suggestions: ['USA','Germany','France','Spain'],
},

You can then access these suggested values directly in the Variants panel.

Merge tag autocomplete

For more information about Merge Tags, visit this documentation.