---
updatedAt: 2026-11-03T17:10:16.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Display Conditions for Email Template Elements

Display conditions in eSputnik let you show different content to different recipients without creating separate emails for each segment. For example, show one product selection to women and another to men.

You can use the following as a condition source:

* [contact fields](https://docs.esputnik.com/docs/contact-fields) — available in any message;
* [event parameters](https://docs.esputnik.com/docs/events-and-behavior-tracking) — available when the email is sent from a triggered workflow;
* external data sources ([BigQuery](https://docs.esputnik.com/docs/exchanging-data-with-google-bigquery), [others](https://docs.esputnik.com/docs/external-data-sources)) — available when an external source is connected to the message.

A condition can be applied to a container, structure, or stripe (see [email structure](https://docs.esputnik.com/docs/email-structure) for details).

> 📘 Note
>
> This is also how to personalize content by authorization status — for example, showing a "Log in" block to anonymous contacts and a different block to authorized ones. Use a contact field or event parameter that reflects the contact's authorization status as the condition source; a proxy domain (used for [URL shortening](https://docs.esputnik.com/docs/creating-a-custom-domain-for-url-shortening)) is unrelated to content personalization. For **In-App messages**, the equivalent is targeting each message to a separate segment in the **To whom** section instead of conditioning elements within one message — see [In-App Publishing and Triggering Rules](https://docs.esputnik.com/docs/in-app-publishing-and-triggering-rules).

***

## How to Apply a Condition

1. Open the email template and select the structure, stripe, or container you need.
2. In the right panel, enable the **Display Conditions** toggle.

<Image align="center" alt="Display Conditions" width="80% " src="https://files.readme.io/6692a8378441d379a8b1bb20ec0c3bca6b6c548947e112e1f4039e8a60ce214a-image.png" />

3. Fill in the fields:

| Field                  | Description                                    |
| ---------------------- | ---------------------------------------------- |
| **Condition name**     | Any name that helps you identify the condition |
| **Description**        | Optional field for notes                       |
| **Code before module** | Opening condition tag                          |
| **Code after module**  | Closing condition tag                          |

In the examples below, `personal` is the name of the contact field list that the `gender` field belongs to. The list name and field name in the variable must match the names in the system (case-insensitive).

**Example for women:**

* Code before module: `<!--#if($personal.gender=='female')-->`
* Code after module: `<!--#end-->`

<Image align="center" alt="Example for women" width="80% " src="https://files.readme.io/b5b8d693ac6986f51de364926d22bb633589745432085c0f69298e951125294d-image.png" />

**Example for men:**

* Code before module: `<!--#if($personal.gender=='male')-->`
* Code after module: `<!--#end-->`

<Image align="center" alt="Example for men" width="80% " src="https://files.readme.io/50cdd6d0fc68c826405320824170b499d007735c110a237e8948016f183ae05f-image.png" />

> **Note**
>
> The value in the condition must exactly match the value stored in the data source:
>
> * For contact fields — check the value in the contact profile or in the [field settings](https://docs.esputnik.com/docs/custom-user-fields); field names are case-insensitive (`$personal.gender` = `$personal.GENDER`);
> * For event parameters — the value is passed in the event payload; parameter names are case-sensitive (`$subscriptionPlan` ≠ `$SubscriptionPlan`);
> * For external sources — the value comes from the connected source; field names are case-sensitive and must exactly match column headers or JSON keys.

An email element with display conditions is marked with an orange icon in the top-left corner.

<Image align="center" alt="Condition icon" width="80% " src="https://files.readme.io/690767fb43d3f57ea638c9b9318414c03e82d15d05a8a6578a5b149f246f1166-image.png" />

***

> **Note:** If the condition value is missing or does not match, the block is not displayed. To show alternative content for such contacts, use `<!--#else-->` directly in the HTML code of the template. The editor interface supports simple conditions only — for more complex constructions (nested conditions, `#else`, loops, array checks), work in HTML. See [Velocity in Messages](https://docs.esputnik.com/docs/using-velocity-in-email) for details.

## How to Test Conditions Before Sending

The testing method depends on the data source your condition uses.

**If the condition uses contact fields** — use one of the following options:

* **Preview** → **Select contact** — shows the email as a specific contact will see it. Choose a contact whose profile has the field value used in the condition.

<Image align="center" alt="Preview" width="80% " src="https://files.readme.io/93589f938769ec9c030a497af79090320989de48589e7ccb7a3339b548fc322c-image.png" />

* **Test** → enter an address → **Send**. Make sure the contact with that address has the required field value.

<Image align="center" alt="Test" width="80% " src="https://files.readme.io/89ca9a1eb9528f621b4adeb45f26f3d3d3b6f96fa9b118f69a55cd348bbedd30-image.png" />

**If the condition uses event parameters or external source data** — click `...` in the top toolbar, select **Configuring dynamic content**, paste the parameters in JSON format, and click **View message**. See [Testing and Troubleshooting Velocity](https://docs.esputnik.com/docs/testing-troubleshooting-velocity) for details.

<Image align="center" alt="Configuring Dynamic content" width="80% " src="https://files.readme.io/383c5541a7fa5e984a380428e91b99d472c15d1f010530d41548cccc480f3061-image.png" />

## Related Articles

* [Contact Field Variables Cheat Sheet](https://docs.esputnik.com/docs/personalization-by-merge-tags)
* [Substituting Event Data into Messages](https://docs.esputnik.com/docs/substituting-events-data-into-messages)
* [Creating Additional Fields](https://docs.esputnik.com/docs/custom-user-fields)
* [Velocity Overview](https://docs.esputnik.com/docs/introduction-to-velocity)

<br />