> ## 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.

# emailTemplateDuplicate

> Copy an email template into a new one: its trigger, subject, preview text, styles and sections. Each top-level section in the copy gets a new id. Returns null if no template with that id is owned by the caller. Errors with `INVALID_NAME` if `name` is blank, and with `INVALID_TRIGGER` if the template's `trigger` is `UNKNOWN`, which cannot be copied.

**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

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

The template's `id`, or its `legacyId` from an earlier version of the Redo API.

**name** `String`

The copy's name. Defaults to the original's name followed by " (Copy)".

## Returns

**emailTemplateDuplicate** `[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 {
  emailTemplateDuplicate(id: "...", name: "...") {
    contentBackgroundColor
    createdAt
    emailBackgroundColor
    id
    legacyId
    linkColor
    name
    previewText
    # ...
  }
}
```


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