# Import, export and duplicate templates

> Import templates from Dragit JSON, HTML or ZIP packages with images, export them again, duplicate templates, and save a campaign as a template.

This page covers moving templates in and out of Emailit: importing files, exporting templates to reuse elsewhere, duplicating a template, and turning a campaign into a template. Importing and exporting are available in the dashboard only.

## Import a template

1. **Open the import dialog.** Go to **Email Marketing → Templates** and select **Import**.

2. **Name it.** Enter a **Name**. Emailit fills in the **Alias** from the name; change it if you need to. If the alias already exists, the import becomes a new draft [version](/docs/templates/versions/) of that template.

3. **Set the defaults.** Optionally enter a **Subject** and a **From** address.

4. **Choose the file.** Under **Template file**, pick a `.json`, `.html`, `.htm` or `.zip` file.

5. **Import.** Select **Import**. The template opens in its editor so you can check it.

| File | Creates | Notes |
| --- | --- | --- |
| `.json` | A **Dragit** template | The file must be a Dragit design, such as one exported from Emailit. It has no HTML until it's saved in the Dragit editor, so open it there and save before you send with it. |
| `.html` or `.htm` | An **HTML** template | The HTML is stored as is. Images keep their existing URLs. |
| `.zip` | A **Dragit** template if the package has `template.json`, otherwise an **HTML** template | Images in the package are uploaded to your workspace and their paths rewritten. A package with only `template.json` also needs a save in the Dragit editor. See the next section. |

## Prepare a ZIP package

Use a ZIP package when your template has local images. Emailit uploads the images to your workspace's CDN and rewrites the paths in the template to the hosted URLs.

```text
welcome-email.zip
├── template.html
├── template.json      optional, the Dragit design
└── images/
    ├── logo.png
    └── hero.jpg
```

- Put `template.html`, `template.json` or both at the root of the archive, not inside a folder.
- Put images directly in `images/`, without subfolders. Supported types are `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp` and `.svg`.
- Refer to images as `images/logo.png` or `./images/logo.png` in the HTML or JSON.
- Other files in the archive are ignored.

To build the archive with the files at its root, zip from inside the folder:

```bash
cd welcome-email
zip -r ../welcome-email.zip template.html images
```

| Limit | Value |
| --- | --- |
| ZIP file size | 25 MB |
| Total size after unzipping | 50 MB |
| Number of images | 80 |
| Size of one image | 8 MB |

If the import fails, the dialog shows the reason:

| Message | Fix |
| --- | --- |
| `ZIP must include template.json and/or template.html at the archive root` | Move the files out of the wrapping folder and zip again. |
| `ZIP file is missing or larger than 25MB` | Compress or resize images, or host some of them yourself. |
| `ZIP contents exceed the uncompressed size limit` | Keep the unzipped contents under 50 MB. |
| `ZIP may include at most 80 images` | Remove unused images. |
| `Image hero.jpg exceeds 8MB` | Resize or compress that image. |
| `template.json is not valid JSON` or `Dragit JSON must be an object` | Export the design again from Dragit. |

## Export a template

Open the menu on a template card in the list, or the menu on the template page, and choose a format:

| Option | Downloads | Contents |
| --- | --- | --- |
| **Export Dragit JSON** | `<alias>.json` | The Dragit design. Shown only for Dragit templates. |
| **Export HTML** | `<alias>.html` | The template's HTML. |
| **Export ZIP** | `<alias>.zip` | `template.html`, `template.json` for Dragit templates, and an `images/` folder |

For a ZIP export, Emailit downloads the images the template uses, including embedded data images, saves them in `images/` and points the template at those copies. An image it can't download, or one larger than 8 MB, keeps its original URL. You can import the exported ZIP into another workspace as it is.

The export uses the version you exported from. Each version is exported separately.

## Duplicate a template

Duplicating copies a template's content, editor, subject, From and Reply-To into a new template.

1. **Start the copy.** Select **Duplicate Template** in the card menu or on the template page.

2. **Name it.** The dialog suggests the name `<name> (Copy)` and a matching alias, such as `welcome-email-copy`. Change them as needed, and adjust the **Subject** and **From** if you like.

3. **Create it.** Select **Duplicate Template**.

With a new alias, the copy is a separate, published template. With an existing alias, it becomes a draft version of that template, and the dialog warns **Alias already exists**.

## Save a campaign as a template

Reuse a campaign's design by saving it as a template. This works for campaigns in any status, including drafts.

1. **Find the campaign.** In **Email Marketing → Campaigns**, open the row menu and select **Save as template**. You can also save from the campaign editor.

2. **Name it.** Enter a **Name** and an **Alias**. The name defaults to the campaign's name.

3. **Save.** Select **Save**, or **Save & Open** to open the new template.

The template gets the campaign's subject, HTML, plain text, Dragit design, From, Reply-To and editor. As with other templates, a new alias is published right away, and an existing alias gets a new draft version.

To go the other way, choose **Choose from templates** in a campaign's content step to start from a template. See [Create a campaign](/docs/campaigns/create/).

## Related

- [Create and edit templates](/docs/templates/editors/)
- [Template versions](/docs/templates/versions/)
- [Priority migration](/docs/programs/priority-migration/) for help moving templates from another provider

---
Source: https://emailit.com/docs/templates/import-export/
