# CreateEmailTemplateInput input


`CreateEmailTemplateInput` is a GraphQL input of the Chameleoon MAX API.

## Input fields

### code

`String!` · required

The template's code: lowercase letters and digits in words joined by `-`, at most 64
characters. It cannot be a built-in template's code.

### name

`String!` · required

The template's display name, 1 to 120 characters.

### resourceKind

[`EmailTemplateResourceKind!`](/chameleoon-max/type/email-template-resource-kind) · required

The kind of record the template is written for.

### syntax

[`EmailTemplateSyntax`](/chameleoon-max/type/email-template-syntax) · default `HTML`

How the template is written, fixed for its whole life. To get an `HTML` copy of a `JSON`
template later, use [`convertEmailTemplateToHtml`](/chameleoon-max/mutation/convert-email-template-to-html).

### variants

[`[EmailTemplateVariantInput!]!`](/chameleoon-max/type/email-template-variant-input) · required

The template's variants: at least one, and each language at most once.

A `JSON` template has exactly one, the all-languages variant (`language` null). A variant of a
language is refused with `VALIDATION` (field `language`) and reason `JSON_ONE_VARIANT`; its
languages are its texts' translations.

### texts

[`[EmailTemplateTextInput!]`](/chameleoon-max/type/email-template-text-input) · default `[]`

The dictionary every variant reads as `t.<key>`.

### defaultTo

[`EmailTemplateRecipient`](/chameleoon-max/type/email-template-recipient)

Who a send goes to when it names no recipient.

### defaultCc

`[String!]` · default `[]`

The addresses every send copies in `cc` when it names no `cc`. Requires the `email.read`
permission when not empty.

### defaultBcc

`[String!]` · default `[]`

The addresses every send copies in `bcc` when it names no `bcc`. Requires the `email.read`
permission when not empty.

### defaultAttachments

[`[EmailTemplateAttachment!]`](/chameleoon-max/type/email-template-attachment) · default `[]`

What a send attaches when it names no attachments.

## Used by

- [`createEmailTemplate`](/chameleoon-max/mutation/create-email-template) (mutation)
