# PreviewEmailTemplateInput input


The template to preview, and drafts to render it with. The draft parts (`subject`, `htmlBody`,
`textBody`, `design`, `texts`) replace the chosen variant's parts and the dictionary for this render
only.

## Input fields

### code

`String!` · required

The template's code.

### language

`String`

A language code from the locales catalogue (`en-GB` reads as `en`). An unknown or omitted code
falls back to the locale of the resource's order, else the organisation's default language,
else `sk`.

### resource

[`EmailResourceInput`](/chameleoon-max/type/email-resource-input)

The record to render with, read as `sendEmail` reads it. If omitted, a template written for a
kind of record renders fixed sample data.

### variables

[`JSON`](/chameleoon-max/type/json)

A JSON object of up to 64 KiB, read in Liquid as `vars.*`.

### sender

[`UUID`](/chameleoon-max/type/uuid)

A sender's MAX id, for `sender.*`. If omitted, the default sender.

### subject

`String`

A draft subject in Liquid.

### htmlBody

`String`

A draft HTML body in Liquid.

### textBody

`String`

A draft plain-text body in Liquid.

### design

[`JSON`](/chameleoon-max/type/json)

A `JSON` template's draft design. It is rendered and checked as a save would, and its HTML and
text replace the variant's. Together with `htmlBody` or `textBody`, it is refused with
`VALIDATION` (field `design`). On an `HTML` template, it is refused with reason
`SYNTAX_MISMATCH`.

### texts

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

A draft dictionary that replaces the template's for this render.

## Used by

- [`previewEmailTemplate`](/chameleoon-max/query/preview-email-template) (query)
