# Use email templates in campaigns and workflows

{% hint style="info" %}

## Before you begin

Before you assign an email template, make sure you’re familiar with the basics:

* Take a look at our guide on creating a workflow: [Create a workflow](/xflow-app/workflows/create-a-workflow.md)
* Check out how to create a campaign: [Create and launch a Restock campaign](/xflow-app/campaigns/create-and-launch-a-restock-campaign.md)
  {% endhint %}

## Assign an email template to a workflow

{% stepper %}
{% step %}

### Assign an email template to the “Send email” action

In the **Send email** action of the Workflow builder, click **Select template** to assign the desired email template.

Add variables to make your subject lines dynamic.

{% hint style="info" %}
📝 Learn more:&#x20;

* [Create an email template](/xflow-app/email-templates/create-an-email-template.md)
* [Understanding personalization variables in email templates](/xflow-app/email-templates/understanding-personalization-variables-in-email-templates.md)
  {% endhint %}

<figure><img src="/files/DqwcQewuC7Vx5tnmpgHI" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Select an email

Select one email template from the list of templates you’ve created — only one template can be selected at a time.

<figure><img src="/files/pEjaAaNsgiyhQZ0muaCs" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Check and save your workflow

Review the assigned email template to ensure it’s correct. You can choose to **Edit** or **Remove** the template if needed.

Don't forget to add content to the Custom variables section to personalize your email.

Click **Save** to apply the changes to your workflow.

{% hint style="info" %}
Learn more: [Available variables in email templates](/xflow-app/email-templates/understanding-personalization-variables-in-email-templates/available-variables-in-email-templates.md#add-custom-variables)
{% endhint %}

<figure><img src="/files/GKsJGjVfEPeVrdUdABf2" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Multiple email templates per Campaign

For each back-in-stock campaign, merchants can assign different email templates to each workflow step.

{% hint style="info" %}
Learn more: [Create a workflow](/xflow-app/workflows/create-a-workflow.md)
{% endhint %}

<figure><img src="/files/UT0ljfZmwsTtNJ3O7jpm" alt=""><figcaption></figcaption></figure>

## Related articles

{% content-ref url="/pages/tEG7HvAAm4FAYdcLDJSn" %}
[Explore pre-built email templates](/xflow-app/email-templates/explore-pre-built-email-templates.md)
{% endcontent-ref %}

{% content-ref url="/pages/nXwNg4IKnFUKyqmD5GJb" %}
[Create an email template](/xflow-app/email-templates/create-an-email-template.md)
{% endcontent-ref %}

{% content-ref url="/pages/zEXuoV3arc2WNCI1i5wq" %}
[Design your email templates](/xflow-app/email-templates/design-your-email-templates.md)
{% endcontent-ref %}

{% content-ref url="/pages/27ltXN2pm7mhbqMs6IcG" %}
[Understanding personalization variables in email templates](/xflow-app/email-templates/understanding-personalization-variables-in-email-templates.md)
{% endcontent-ref %}

{% content-ref url="/pages/9TMXBePs6zA8bV4oj3K6" %}
[Preview and test your email](/xflow-app/email-templates/preview-and-test-your-email.md)
{% endcontent-ref %}

***

#### 📩 **Need help?**

We’re here to make your XFlow experience smooth and successful.\
Our support team is always ready to assist you—no matter how big or small your question is.

<a href="https://admin.shopify.com/apps/xflow?chat=true&#x26;utm_source=foxecom&#x26;utm_medium=help_center_xflow_using_email_templates_in_campaigns_and_workflows&#x26;utm_campaign=cta_button&#x26;utm_term=chat_now" class="button primary" data-icon="comment-lines">Chat now</a> <a href="mailto:contact@help.xflow.so" class="button secondary" data-icon="envelopes">Message us</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.foxecom.com/xflow-app/email-templates/use-email-templates-in-campaigns-and-workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
