> For the complete documentation index, see [llms.txt](https://docs.loopit.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loopit.co/getting-started/ai-chat/writing-templates-with-ai.md). Agents can also search and read this documentation through its [MCP server](https://docs.loopit.co/~gitbook/mcp).

# Writing Templates with AI

Use AI to write new email and SMS templates, rewrite existing ones, and generate your email header and footer text.

### About Writing Templates with AI

AI can write the text of your [email templates](https://docs.loopit.co/settings/email-templates.md) and communications (SMS) templates for you. You choose the tone and length, add anything that must be included, and AI writes a draft you can edit before saving.

{% hint style="info" %}
**Create with AI** and **AI Suggestion** are available when AI Chat is enabled for your workspace and your user. Please reach out to our support via **<support@loopit.co>** to enable **AI Chat**.
{% endhint %}

### Creating a Template with AI

To create a new template with AI:

1. Navigate to **Settings > Email templates** (or **Settings > Communications templates** for SMS).
2. Select **Create Email Template** (or **Create Template** on the **Communications templates** page).
3. Enter the **Template Name**, **Description** and **Select Module**.

   The module decides which dynamic fields the template can use, and which workflows can use it.
4. Select **Create with AI**.
5. Choose the **Tone of Voice**: **Professional**, **Friendly**, **Reassuring**, **Urgent** or **Other**.

   If you choose **Other**, describe the tone you want.
6. Choose the **Length**: **Shorter**, **Standard** or **Longer**.
7. Optionally, add instructions in **Anything specific to include?**, for example "Highlight the most important details first".

   <div align="left" data-with-frame="true"><figure><img src="https://2451226423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT8x4qsJr8A1IrE3A8r3f%2Fuploads%2Fgit-blob-0bbaf0ea83c02645cf0a7db5b5cfacb2e8ed16eb%2Fai-template-create-with-ai.png?alt=media" alt="The Create with AI form" width="563"><figcaption></figcaption></figure></div>
8. Select **Create Template**. The template is created and opened so you can review it.

### Rewriting an Existing Template with AI

To rewrite an existing template:

1. Open the template from **Settings > Email templates** or **Settings > Communications templates**.
2. Select **AI Suggestion**.
3. Choose the **Tone of Voice** and **Length**, and add anything specific to include.
4. Select **Generate Suggestion**.

   <div align="left" data-with-frame="true"><figure><img src="https://2451226423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT8x4qsJr8A1IrE3A8r3f%2Fuploads%2Fgit-blob-a2c5dc7b9fd27268f4233752c065d6c2beec8b39%2Fai-template-suggestion.png?alt=media" alt="The AI Suggestion form on an email template" width="563"><figcaption></figcaption></figure></div>
5. The suggestion replaces the subject and text in the editor, and you'll see **AI suggestion applied — review and save when ready**.
6. Review the text, then select **Save**. If you don't want the suggestion, leave the page without saving.

### Generating Email Header and Footer Text

When you create or edit an email wrapper, you can let AI write the header or footer text.

{% hint style="info" %}
The **Email wrapper** tab is only shown when email wrappers are enabled for your workspace. Please reach out to our support via **<support@loopit.co>** to enable **Email wrappers**.
{% endhint %}

1. Navigate to **Settings > Email templates** and open the **Email wrapper** tab.
2. Select **New wrapper**, or edit an existing wrapper.
3. Select **✨ Generate with AI** above **Header text** or **Footer text**.

   **Header text** is shown when you choose to write your own header.

   <div align="left" data-with-frame="true"><figure><img src="https://2451226423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT8x4qsJr8A1IrE3A8r3f%2Fuploads%2Fgit-blob-2e37f3e3e2479ecd729e1fd4af2ad6a6457dcd66%2Fai-wrapper-generate.png?alt=media" alt="Generate with AI in the email wrapper" width="563"><figcaption></figcaption></figure></div>
4. Review the text, change anything you need, and save the wrapper.

### Important Things to Note

* AI writes a draft. Always check the text, dynamic fields and links before you use the template in a workflow.
* **AI Suggestion** replaces the current subject and text in the editor. Nothing is saved until you select **Save**.
* You need permission to update email templates to use these options.
