> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# emailTemplateCreateFromSaved

> Create an email template from a saved template in the store's email library (saved, forwarded or uploaded): its sections, styles, subject and preview text. Marks the saved template as just used (`lastUsedAt`). Returns null if the store has no such saved template. Top-level blocks bound to data the new template's trigger does not provide are left out, and so are blocks (top level or in a column) that list the trigger's products when the new trigger has none. Errors: INVALID_NAME if `name` is blank; INVALID_TRIGGER when the saved template's trigger is not one this API offers and no `trigger` is given; TEMPLATE_VARIABLES_UNAVAILABLE (400) when any other text, link, column or saved section uses data the new template's trigger does not provide; SAVED_EMAIL_TEMPLATE_GENERATING (409) while the saved template is still being built.

**Required scopes:** [`marketing_templates_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_templates_write)

**Store must have one of:** `EMAIL_SMS`, `HSA`, `ORDER_TRACKING`, `RETURNS`, `TNPL`, `REVIEWS`

## Arguments

**name** `String`

The new template's name. Cannot be blank. Defaults to the saved template's name followed by " (Copy)".

**savedEmailTemplateId** `ID!` *required*

The saved template's `id`.

**trigger** `[MarketingTrigger](/docs/api-reference/v3/reference/marketing/marketing-trigger)`

The new template's trigger, which decides which data its blocks and variables can use. Defaults to the saved template's. Required when the saved template's trigger is UNKNOWN, which forwarded templates always report. Cannot be UNKNOWN.

## Returns

**emailTemplateCreateFromSaved** `[EmailTemplate](/docs/api-reference/v3/reference/marketing/email-template)`

The content of an email, as the merchant authored it.

**fields**

**contentBackgroundColor** `String!` *required*

The content canvas background, as set under Email styles in the email builder.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the template was created.

**emailBackgroundColor** `String!` *required*

The email background, as set under Email styles in the email builder.

**id** `ID!` *required*

The id of this template.

**legacyId** `String!` *required*

The template's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**linkColor** `String`

The default link color, as set under Email styles in the email builder. Null when the merchant left it unset.

**localization** `[EmailTemplateLocalization](/docs/api-reference/v3/reference/marketing/email-template-localization)`

The template's source language, its translatable strings and its saved translations. Null if the template was deleted while reading.

**Requires:** [`marketing_templates_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

**fields**

**entries** `[\[EmailTemplateTranslationEntry!\]!](/docs/api-reference/v3/reference/marketing/email-template-translation-entry)` *required*

The template's translatable strings, in the source language.

**fields**

**field** `[EmailTemplateTranslationField!](/docs/api-reference/v3/reference/marketing/email-template-translation-field)` *required*

Where in the email the string lives.

**key** `String!` *required*

The string's key, stable while its block exists. Translations are written against it.

**kind** `[EmailTemplateTranslationEntryKind!](/docs/api-reference/v3/reference/marketing/email-template-translation-entry-kind)` *required*

Whether `text` is plain text or HTML.

**text** `String!` *required*

The string in the email's source language.

**retranslating** `Boolean!` *required*

Whether the saved translations are being redone after the source changed. A redo re-translates every string of each saved language, replacing hand-edited ones.

**sourceLocale** `[EmailTemplateLocale](/docs/api-reference/v3/reference/marketing/email-template-locale)`

The language the template is written in. Null when none has been set, which sends the source copy as written.

**translations** `[\[EmailTemplateTranslation!\]!](/docs/api-reference/v3/reference/marketing/email-template-translation)` *required*

The saved translations, one per language.

**fields**

**locale** `[EmailTemplateLocale!](/docs/api-reference/v3/reference/marketing/email-template-locale)` *required*

The language of this copy.

**texts** `[\[EmailTemplateTranslationText!\]!](/docs/api-reference/v3/reference/marketing/email-template-translation-text)` *required*

The translated strings, by source `key`. A source string with no entry here is sent in the source language.

**name** `String!` *required*

The merchant-facing name of the template.

**preview** `[EmailTemplatePreview](/docs/api-reference/v3/reference/marketing/email-template-preview)`

Render this template, to see what recipients get. Use a width of about 375 for a phone.

**Requires:** [`marketing_templates_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

**fields**

**Arguments**

**eventId** `ID`

Render with this recent event's data instead of sample data: a 24-character hex event id. A well-formed id that can't be found falls back to sample data.

**width** `Int`

Viewport width of the screenshot, 320-1200 pixels.

**Fields**

**height** `Int`

The screenshot's full height in pixels.

**html** `String!` *required*

The rendered email HTML, as a recipient's client would receive it.

**imageUrl** `String`

A link to a full-length PNG screenshot at the requested width. It expires after an hour.

**sizeBytes** `Int!` *required*

The size of `html` in bytes (UTF-8), counted the way the Redo email builder counts it.

**sizeLimitBytes** `Int!` *required*

The size above which Redo flags an email: 90% of the 102 KB at which Gmail clips a message. The email builder shows a larger email in red.

**width** `Int`

The screenshot's width in pixels.

**previewText** `String`

The preview text shown after the subject in an inbox. Null when the merchant left it unset.

**sections** `[\[EmailTemplateSection!\]!](/docs/api-reference/v3/reference/marketing/email-template-section)` *required*

The blocks that make up the email body, in order. Nested column children keep their own ids. A type this API version does not model field-by-field is returned as EmailTemplateUnknownSection.

**sectionsJson** `[\[JSON!\]!](/docs/api-reference/v3/reference/common/json)` *required*

`sections` with every field selected, as JSON: one element per root block, in order, with `__typename` and nested column children. Empty or unreadable stored sections are \[]. Edits go through operations.

**subject** `String!` *required*

The subject line **as authored**, before per-recipient substitution. A subject containing `{{ }}` placeholders is filled in per customer at send time, and some sends prepend a prefix, so this is not necessarily the subject any one customer saw. Empty when the template has no subject of its own.

**trigger** `[MarketingTrigger!](/docs/api-reference/v3/reference/marketing/marketing-trigger)` *required*

The trigger context this template is valid for. Immutable after create. UNKNOWN when the stored trigger is not modeled in this API version.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the template was last edited. Templates stay editable after the campaigns that used them have finished, so compare this against a campaign's `finishedAt` to tell whether the content here is still what that campaign actually sent.

## Example

```graphql theme={null}
mutation {
  emailTemplateCreateFromSaved(name: "...", savedEmailTemplateId: "...", trigger: ADDRESS_VERIFICATION_FAILED) {
    contentBackgroundColor
    createdAt
    emailBackgroundColor
    id
    legacyId
    linkColor
    name
    previewText
    # ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.