# SendEmailInput input


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

## Input fields

### template

`String`

The code of a template ([`emailTemplates`](/chameleoon-max/query/email-templates)). Optional when `subject` and `html` are
given.

### resource

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

The record the message is about. The template's data and the default recipient come from it,
and the message is linked to it. A shipment's message is also linked to its order.

- A template is written for its own kind of record. A template for `INVOICE` also sends for a
  `SALES_ORDER` or a `SHIPMENT`. Its data then carries the order's invoice, the same one an
  `orderInvoice` attachment takes: the governing invoice (only the order's invoice number when
  your API key cannot see that invoice), else, when the order has an uploaded `INVOICE`
  document, only the order's invoice number.
- A `SHIPMENT` without an order is refused with `VALIDATION` (field `resource`).

### sender

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

The MAX id of the sender to send through (`NO_SENDER` when it is disabled). If omitted, the
default sender of the record's company, else the organisation's default (`NO_SENDER` when there
is none).

### to

`[String!]`

The recipients. If omitted, the template's default (the customer). An empty list means nobody
(`NO_RECIPIENT`). At most 50 addresses together with `cc` and `bcc`.

### cc

`[String!]`

The copy recipients. If omitted, the template's default. An address also in `to` is left out.

### bcc

`[String!]`

The blind copy recipients. If omitted, the template's default. An address also in `to` or `cc`
is left out.

### language

`String`

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

### subject

`String`

A subject in Liquid that replaces the template's.

### html

`String`

An HTML body that replaces the template's. Liquid still applies.

### text

`String`

A plain-text body that replaces the template's.

### variables

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

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

### attachments

[`[EmailAttachmentInput!]`](/chameleoon-max/type/email-attachment-input)

The attachments. If omitted, the template's default attachments. An empty list sends none. At
most 20, and 15 MiB in all.

### requestId

`String!` · required

Your idempotency key for this call, 1 to 128 characters. See [`sendEmail`](/chameleoon-max/mutation/send-email).

## Used by

- [`sendEmail`](/chameleoon-max/mutation/send-email) (mutation)
