Chameleoon MAX · Email templates
setEmailTemplateVariant mutation
setEmailTemplateVariant is a GraphQL mutation of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Creates or replaces one variant of the template. Call it with the version you read to change
a subject or body, or to add a language.
Permissions
Requires the emailTemplate.manage permission.
HTML templates
- If
htmlBodyis omitted, the variant keeps its own HTML. WhentextBodyis omitted too, it also keeps its own text. - A new variant without
htmlBodycopies the HTML of the all-languages variant, else theskvariant, else the first variant. - A
designis refused withVALIDATIONand reasonSYNTAX_MISMATCH.
JSON templates
- Only the all-languages variant can be set. A
languageis refused withVALIDATION(fieldlanguage) and reasonJSON_ONE_VARIANT, because its languages are its translations. - If
designis omitted, the variant keeps its own design. htmlBodyandtextBodyare refused withVALIDATIONand reasonSYNTAX_MISMATCH.
Errors
CONFLICT with reason TEMPLATE_CHANGED when somebody saved the template after you read it.
Arguments
input:SetEmailTemplateVariantInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.