# Create & Preview an Email Template with Dynamic Content

Dynamic Content is a feature that allows you to personalize your emails depending on the recipient's attributes. You don't need to create separate email campaigns for separate audiences. You can have one template with design blocks for 2 separate recipient groups (as in the example below) and send it out, saving your time.

Let's look at the following example divided by gender and location.

* Women in the US should receive an email that is relevant to them
* Men in the UK should receive one relevant to them.

## How to Create an Email Template with Dynamic Content

You can set the display condition for each block from the bottom left icon. Or you can access it from the right side panel of the template editor console – ‘*Add Display Condition*’.&#x20;

<figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FbK5wuZo2DSU0L27wXn90%2Fimage.png?alt=media&#x26;token=59e9bbcd-e881-47d7-b112-af49efda1a41" alt=""><figcaption></figcaption></figure>

Another option is that you can find it on the selected block itself as a tick mark to the bottom left of it.&#x20;

<figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2F0oSJHdxmqxhrizdtztdj%2Fimage.png?alt=media&#x26;token=550e13be-c0ba-4edb-943d-977dffda972f" alt="" width="375"><figcaption></figcaption></figure>

#### To set a display condition for any block within the template, follow these steps.

1. Create different versions of a block that you want to test in the same email template.
2. Select the block which you want to display for audience 1.
3. Click **Add Display Condition** section on the right hand panel.&#x20;

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdI7DyjZIde5HtF1Jl4wf12to1Ychhhj8lUYkUNgrKDVBNMFFXWQ2uObp40RDSZxqvlWDzGHoBMsJJblbTzs7JOKaP2AR9evYLaPv-sihjJ9_Ky7lDf-G-aplCZ-_vJ_I9jMbH10A?key=lYIuAOJZuDXXpIk3m9tRjyA5" alt=""><figcaption></figcaption></figure>
4. Enter a label for the condition in the **Label** field.
5. Click **Add Filter**.&#x20;

   <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FTng13pzS2b83yAoTQclL%2Fimage.png?alt=media&#x26;token=0960150b-2301-4c6e-bb27-37c7ada7fe70" alt="" width="375"><figcaption></figcaption></figure>
6. Then click **Select Field** right below that.
7. Select from **Contact Attributes.** With this option you can serve different emails to different contacts based on information about them, like their location, age etc. As in the example above, you can have different product catalogues and the corresponding messaging for males in USA and females in the UK.
8. To do this, follow these steps.

   1. Click Contact Attributes.
   2. Click the next dropdown and select **Gender**.
   3. Click **In**.
   4. Select **Female** and click the green tick.&#x20;
   5.

   ```
   <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FuwFgOGKOOpaSxtvpiLLm%2Fimage.png?alt=media&#x26;token=19443602-8599-4812-bdf3-4315bb1e7efb" alt="" width="375"><figcaption></figcaption></figure>
   ```

   6. Click the **Select** dropdown.&#x20;
   7. Select **Contact Attributes** again and select Location.
   8. Set the location for females: *United States* and click the green tick .&#x20;

      <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FNTGGujiGDhZZgScikho9%2Fimage.png?alt=media&#x26;token=3257f0de-c83b-423f-81b5-d8cbae472742" alt=""><figcaption></figcaption></figure>
9. Similarly, you can create the conditions for the UK-based male audience (audience 2):
   1. Select the block which you want to display for the audience 2.
   2. Click on *Display Condition*&#x20;
   3. Set the right conditions for the UK-based male audience (audience 2).&#x20;

      <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2F4sdKydQ4HsCefhckqEoY%2Fimage.png?alt=media&#x26;token=5bc4aea0-e557-4d29-9b38-5a9620040ed5" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**Using AND/OR Logic for Content Targeting**

The AND/OR selector helps you combine multiple conditions for precise content targeting.

**AND Logic Example:** To show content only to contacts who meet ALL of these criteria.

**OR Logic Example:** To show content to contacts who meet ANY of these criteria.
{% endhint %}

**Results**

Here’s what the 2 different contact segments would receive in their inbox.

<figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FJVL6DRRXAAnaNbzf5bmw%2Fimage.png?alt=media&#x26;token=a84af0ab-74ef-4756-91ee-952c4fb7a8b5" alt=""><figcaption></figcaption></figure>

## Preview Dynamic Content Variant within the Template

After you create an email template with dynamic content blocks, you can preview the variants in the ***Preview*** mode.

You can preview how the email will look for two different audience segments with dynamic content sections.

#### To preview the variants for these 2 audience segments, perform the following steps:

1. Click the preview icon.&#x20;

   <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FciektOLu0uSoOBICFUXQ%2Fimage.png?alt=media&#x26;token=c5406d3d-29fb-40a4-9e61-d194329ab90d" alt=""><figcaption></figcaption></figure>
2. Click the *Email Preview* radio button.
3. Select the first variant.
4. Click *Preview*. You can see the template preview for the first audience segment.
5. Click the cross icon to exit the first preview.&#x20;

   <figure><img src="https://167344003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsxN9AGLZMIc5C8dx3zU7%2Fuploads%2FUbhepXiV8PPyf9Wd9GC1%2Fimage.png?alt=media&#x26;token=957675fb-0aaa-495b-895c-ab4ee07066e8" alt="" width="563"><figcaption></figcaption></figure>
6. Click the preview icon.
7. Deselect the first variant and select the second.
8. Click *Preview*. Now, you can see the template preview for the second audience segment.

Once you’re done creating your template, you can preview it, download as a .html file or save it.
