# Using Customer Profiles to Preview Emails


Simulate customer cohorts or key business scenarios across workspaces.

Preview emails and other templates with a variety of profiles to ensure that your customers see the right content.

## Creating Customer Profiles

Customer Profiles can be added or edited using our Data Builder or as JSON objects:

### Create and Edit a Customer Profile by Name and Placeholder using our Data Builder

1. Select **Data** from the [administration dashboard](https://app.dyspatch.io/admin/).
2. Select the **Customer Profiles** tab and click **Add Profile**.
3. Name your Customer Profile, provide an optional description, and **Create Profile**.
4. Add your profile's properties as key value pairs. Add the key in the **Name** field, and the value in the **Placeholder Value** field. Duplicate a row to add more properties.

![Customer Profile data input page with mock data](https://docs.dyspatch.io/img/emails/customer-profile-paid-user.png "class: idm img-size-75")

### Create and Edit a Customer Profile as JSON

You can input or edit your Customer Profile data in JSON format by toggling **Show JSON Editor**.

![Customer Profile JSON editor page with mock data](https://docs.dyspatch.io/img/emails/customer-profile-paid-user-json.png)

<div class="highlight note">Keys/Names in JSON do not contain spaces</div>

## Assigning Customer Profiles to a Workspace

Keep your workspace's dynamic data organized by assigning Customer Profiles and customer profile folders to workspaces.

Select the " <svg xmlns="http://www.w3.org/2000/svg" width="3" height="11" viewBox="0 0 3 11"><title>3 dot</title><path fill="currentColor" fill-rule="evenodd" d="M1.344 8c.363 0 .677.133.944.4.267.267.4.581.4.944s-.133.677-.4.944c-.267.267-.581.4-.944.4s-.677-.133-.944-.4a1.291 1.291 0 0 1-.4-.944c0-.363.133-.677.4-.944.267-.267.581-.4.944-.4zm0-4c.363 0 .677.133.944.4.267.267.4.581.4.944s-.133.677-.4.944c-.267.267-.581.4-.944.4s-.677-.133-.944-.4a1.291 1.291 0 0 1-.4-.944c0-.363.133-.677.4-.944.267-.267.581-.4.944-.4zm0-1.312a1.29 1.29 0 0 1-.944-.4 1.291 1.291 0 0 1-.4-.944C0 .981.133.667.4.4.667.133.981 0 1.344 0s.677.133.944.4c.267.267.4.581.4.944s-.133.677-.4.944a1.29 1.29 0 0 1-.944.4z"></path></svg> " menu next to the profile or folder and select **Manage Workspaces**. Toggle a workspace to **Active** to use that customer profile, or all profiles in a folder, in that workspace.

![Customer profile dropdown menu from the 3 dot menu on the Admin Data dashboard](https://docs.dyspatch.io/img/emails/customer-profiles-manage-workspace.png "class: idm")

<div class="highlight tip">If you'd like your data set accessible to all workspaces, consider using <a href='#using-global-variables'>Global Variables</a> alongside different Customer Profiles</div>

## Using Customer Profiles

Customer Profiles, as well as [Global Variables](#using-global-variables) and email specific [Template Data](/emails/testing_your_email_with_preview_data/#building-preview-data-using-the-data-builder), can be used to build and preview dynamic copy, urls, and different blocks of an email.

### Adding Dynamic Variables to an Email

Add dynamic variables as values by wrapping the variable name inside of an "@{}". This can be used for copy, metadata, urls, and anything else your ESP supports.

![Title of an email using a dynamic variable](https://docs.dyspatch.io/img/emails/dynamic-variable.png)

<div class="highlight tip">DML variables export to different template languages without changing your Dyspatch email so you're not locked into one ESP or templating language</div>

### Render Blocks Dynamically with Conditionals

To increase user engagement, many organizations use customer data to offer their customers a tailored email based on their preferences or account status.

![Block with conditional rendering set in the Email Builder](https://docs.dyspatch.io/img/emails/conditional-block.png)

Select a block in the Email Builder and **Add Logic** to the **Display Options** to set the conditional logic for when to display that block's content.

See more about [using conditionals here](/emails/using_conditionals/).

## Previewing Templates with Customer Profiles

### Previewing Dynamic Content in the Email Builder

After you have created your email, you can preview the email using a Customer Profile. This will use all the values associated with that profile.

1. Toggle on <b>Preview with:</b> at the bottom of the Email Builder
2. Select the Customer Profile you'd like to preview

<img class="img-status img-border"  src="https://docs.dyspatch.io/img/emails/customer-profiles-previewing.gif" alt="Selecting different profiles to preview emails"/>

The email preview will be updated with the data from your customer profile.

### Previewing Dynamic Content in Device Previews

Select a Customer Profile as your **Content** when generating device previews or sending test emails to see exactly what you're communicating to your customers.

<div class="highlight tip"><a href="/emails/testing_your_email_with_preview_data">Template Data</a> is an alternative to Customer Profiles that is stored in an individual template, for unique and one-off emails or use-cases</div>

### Enabling and Disabling Dynamic Data Previews

The **Data** tab in the Email Builder shows a dot whenever **Dynamic Data** preview is active for that email — from **Template**, **Global**, or a selected **Customer Profile**.

#### Dynamic Data Preview On
![Data tab with Template, Global, and a Customer Profile all enabled, showing the green dot next to the Data tab](https://docs.dyspatch.io/img/emails/dynamic-data-all-enabled.png "class: idm img-size-75")

#### Dynamic Data Preview Off

![Data tab with Template and Global off and no Customer Profile selected, with no green dot next to the Data tab](https://docs.dyspatch.io/img/emails/dynamic-data-none-enabled.png "class: idm img-size-75")


<div class="highlight note">Turning off <b>Template</b> and <b>Global</b>, with no Customer Profile selected, also turns off conditional block rendering. Every block in your preview then shows, regardless of its display logic. Turning any of the three back on turns conditional block rendering on again, shown by the green dot next to the Data tab.</div>

## Using Global Variables

If you'd like your entire organization testing off of the same default data set, an *Admin* or *Developer* can include Global Variables the same way as Customer Profiles, but on the <a href="https://app.dyspatch.io/admin/data/globals" target='_blank'>admin data page</a>. These variables work the same as Customer Profiles with the added benefit of being always available to all emails in all workspaces.

Global Variable names/keys also provide auto-population when adding DML variables in the *rich text editor* of the email builder.

View more on [Testing with Device Previews](/emails/testing_with_device_previews/).