Adding Conditional Logic to Communication Templates

Nicolas Audet
Nicolas Audet
  • Updated

Overview

Communication Templates in gaiia allow for advanced customization, enabling you to tailor messages based on specific attributes of the recipient’s account. This functionality can help ensure that only relevant information is displayed to the user, such as showing or hiding content based on the account’s internet provider.

This article walks through setting up conditional logic in templates, using an example where the content is customized based on the recipient's internet provider.

 

Adding Conditional Logic to Templates

Both system and custom templates in Gaiia support the addition of conditional logic, allowing for personalized communication. This logic is applied to specific blocks of text within the template, depending on attributes related to the account (using available merge tags).

Steps to Add Conditional Logic:

  1. Navigate to Communications under the Admin section.
  2. Open the template you want to edit.
  3. Select the text block that you wish to apply the conditional logic to. Use the Layers tab for easy selection if needed.
  4. On the right-side panel, ensure the Configuration tab is selected.
  5. Scroll down to locate the Condition section and toggle it ON.
  6. Once the toggle is enabled, the field will allow you to begin adding the condition.

Basic Structure of Conditional Logic

Each condition comprises three components:

  1. Path: The attribute from the account (usually defined using a merge tag) that will determine whether to display the text block.
  2. Operator: Defines how the value from the Path is compared (e.g., equals, not equals).
  3. Right: The specific value to match against the attribute in the Path.

Finding the Path Value

To find the correct Path value, you will often use a merge tag. Simply add the merge tag to the template temporarily and copy it, making sure to remove the curly brackets {}. For instance, if using the internet provider attribute, the merge tag would look like {{entity.internetProvider}}, but for the Path field, you’ll enter entity.internetProvider.

Operator Options

Here are the available operators to define how the Path is evaluated:

  • Truthy: Shows content if the Path value is true (e.g., autopay is enabled).
  • Falsy: Shows content if the Path value is false (e.g., autopay is disabled).
  • ==: The Path value equals a specific value (e.g., a certain internet provider).
  • !=: The Path value does not equal a certain value.
  • >: The Path value is greater than a specific number.
  • >=: The Path value is greater than or equal to a specific number.
  • <: The Path value is less than a specific number.
  • <=: The Path value is less than or equal to a specific number.

 

Example: Conditional Logic Based on Internet Provider

Here’s how to apply conditional logic to display specific text based on the account’s internet provider.

Step-by-Step Guide:

  1. Write the text you want to display conditionally in the template. This text will always be visible during editing, but the condition you apply will ensure it is hidden or shown based on the recipient’s details.
  2. Select the block of text you want to add the condition to.
  3. Use the following values for the conditional logic fields:
    • Path: entity.internetProvider
    • Operator: ==
    • Right: One of the following values, depending on the provider:
      • NONE
      • SUPER INTERNET
      • FAST SPEED
      • FIBER NETWORK

For instance, if you want to display a message only to accounts that have the internet provider "SUPER INTERNET", the setup will look like:

  • Path: entity.internetProvider
  • Operator: ==
  • Right: SUPER INTERNET

 

Conclusion

By leveraging conditional logic in gaiia communication templates, you can easily personalize content for each recipient, ensuring that only relevant messages are shown based on their account attributes. Use the above steps to implement tailored messages based on conditions like the recipient's internet provider.

Was this article helpful?

Have more questions? Submit a request