> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/emails/templates/publish.md).

# Publish, archive, unarchive

Email templates have no publish step — a saved template is in use; Archive takes it out of use.

**Where:** Email → Templates → a template → **Actions** · `/projects/<project>/emails/templates/<templateId>/edit`

{% hint style="warning" %}
Cloud has no **Publish** step for email templates, and the API has none either: there is no draft. A template is in use as soon as you press **Create** or **Update** — the next send that points at its id uses the new content. To take a template out of use, **Archive** it; **Unarchive** brings it back.
{% endhint %}

## Before you start

* A saved template with no unsaved changes (the **Actions** items are off while the form has changes).
* Permission `email:update`.
* A template used by a trigger or an authentication flow cannot be archived — see [Message templates](/codemash/cloud/concepts/message-templates.md).

## Steps

1. Open the template, for example `Monthly newsletter`, and open **Actions**. **Archive** is on for an active template; **Unarchive** is off.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-f2047206bdd0d1e3de3d1cdfb1ee90f939443c3b%2Ftemplates-publish-1.png?alt=media" alt="Actions menu of Monthly newsletter: Create Campaign, Archive, Unarchive (off), Clone, See documentation, Delete"><figcaption><p><strong>Archive</strong> on an active template.</p></figcaption></figure>
2. Press **Archive**. Cloud goes back to the list.
3. To bring it back, open the template again (from its address, or the id from the API) and press **Actions → Unarchive**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-1e0f959edbfb49e84ff6e20cde2a90830c8c80f4%2Ftemplates-publish-3.png?alt=media" alt="Actions menu of an archived template: Archive off, Unarchive on"><figcaption><p><strong>Unarchive</strong> on an archived template.</p></figcaption></figure>

## Result

An archived template disappears from **Email → Templates** and from the template pickers of campaigns and triggers. It is not deleted: the API still returns it with `showArchived: true`, and **Unarchive** makes it active again.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-3125cf165d0f19ae48307afc58ac67d1891bdf28%2Ftemplates-publish-2.png?alt=media" alt="Email Templates list without Monthly newsletter"><figcaption><p>The list after <strong>Archive</strong>: Monthly newsletter is gone.</p></figcaption></figure>

## Change or remove it later

* **Edit** — [Create or edit a template](/codemash/cloud/emails/templates/editor.md); saving is the "publish".
* **Delete** for good — [Delete a template](/codemash/cloud/emails/templates/delete.md).

## Do it from code

```ts
await norbix.hub.notifications.archiveEmailTemplate({ id });   // out of use
await norbix.hub.notifications.unArchiveEmailTemplate({ id }); // back in use
```

```sh
norbix hub notifications email template archive --id tmpl_4VsLPkwCf81T9jTVxtdnni
```

API: [Archive Email Template](/codemash/api-reference/notifications/email/archive-email-template.md) · [Unarchive Email Template](/codemash/api-reference/notifications/email/un-archive-email-template.md)
