EmailTemplate type
An e-mail template: the subject and bodies of an e-mail, written in Liquid. It is one of the organisation's templates or a MAX built-in one.
- A template has a variant per language, and an all-languages variant for every language without
its own. A send in a language uses that language's variant, else the all-languages one, else the
variant in the organisation's default language, else the first in
sk,cs,en, then code order. - Its texts are a dictionary every variant reads as
t.<key>. A text is taken in the send's language, else the organisation's default language, elseen, else the first translation there is, else empty. A missing translation never fails a send. - A built-in template comes first in the list, has no
idand one all-languages variant without a subject, and cannot be written. Copy it to change it.
Fields
id
The template's MAX id. Null for a built-in template.
code
String!
The template's code, which identifies it: lowercase words joined by -.
name
String!
The template's display name.
builtIn
Boolean!
Whether this is a MAX built-in template.
resourceKind
The kind of record the template is written for.
syntax
How the template is written, fixed for its whole life. Built-in templates are JSON.
variants
The subject and bodies per language: the all-languages variant first, then sk, cs, en,
then the rest by code.
- A plain list, not a connection: one variant per language the template is written in.
- A
JSONtemplate has exactly one, the all-languages variant. Its languages are its translations. - Priced as 26 variants (one per language of the locales catalogue, plus the all-languages one), however many it holds.
- Costs 26 points plus 26 × one variant's selection.
languages
[String!]!
The languages that have a variant of their own, in sk, cs, en order, then the rest by
code. Priced as 25 languages (the locales catalogue), however many it holds.
Costs 25 points.
allLanguages
Boolean!
Whether the template has the all-languages variant.
texts
Arguments:
first:Intafter:Stringlast:Intbefore:String
The dictionary every variant reads as t.<key>, by key. A template has at most 200 keys.
- A connection, paged with
first/afterorlast/before, at most 250 a page. - Its cursors belong to this template's texts and are refused anywhere else.
- A page costs 2 + first (or last) × the cost of one node.
defaultTo
Who a send goes to when it names no recipient. Null when there is no default.
defaultCc
[String!]!
The addresses every send copies in cc when it names no cc.
Priced as 50 addresses, however many it holds.
Costs 50 points.
defaultBcc
[String!]!
The addresses every send copies in bcc when it names no bcc.
Priced as 50 addresses, however many it holds.
Costs 50 points.
defaultAttachments
What a send attaches when it names no attachments.
Priced as 2 attachments, however many it holds.
Costs 2 points.
copiedFrom
String
The code of the template this one was copied from. Null when it is not a copy.
version
Int!
The template's version. Send it back on a change; the change is refused when somebody saved
first. 0 for a built-in template.
Used by
convertEmailTemplateToHtml(mutation)copyEmailTemplate(mutation)createEmailTemplate(mutation)removeEmailTemplateVariant(mutation)saveEmailTemplateDesign(mutation)setEmailTemplateTexts(mutation)setEmailTemplateVariant(mutation)updateEmailTemplate(mutation)emailTemplate(query)EmailTemplateConnectionEmailTemplateEdge