Chameleoon MAX · Email templates
createEmailTemplate mutation
createEmailTemplate 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 an e-mail template of the organisation. Call it to add a template of your own. To start
from an existing one, use copyEmailTemplate.
Permissions
- Requires the
emailTemplate.managepermission. - A non-empty
defaultCcordefaultBccalso requires theemail.readpermission, because every send copies those addresses. Without it, the call fails withFORBIDDEN_ROLE.
Errors
VALIDATIONwith reasonBUILT_IN_CODE(fieldcode) when the code is a built-in template's.CONFLICTwith reasonCODE_TAKENwhen the organisation already has a template with the code.VALIDATIONwith reasonJSON_ONE_VARIANT(fieldlanguage) when aJSONtemplate has a variant of a language. AJSONtemplate has exactly one variant, the all-languages one, and its languages are its translations.VALIDATIONwith reasonUNKNOWN_LANGUAGEwhen a language is not in the locales catalogue.VALIDATIONwith reasonTEMPLATE_ERROR,DESIGN_INVALID,DESIGN_TOO_LARGEorSYNTAX_MISMATCHwhen a variant's content is refused (seeEmailTemplateVariant).
Arguments
input:CreateEmailTemplateInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.