Chameleoon MAX · Email templates
previewEmailTemplate query
previewEmailTemplate is a GraphQL query of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Renders a template as sendEmail would, and stores and queues nothing. Use it to
check a template, or a draft of its parts, before you save or send it.
Permissions
- Requires the
email.sendoremailTemplate.managepermission. - The
resourceis read under your API key's permissions exactly assendEmailreads it, and requires the same permissions. This includes the template's default attachment:invoice.read, and alsoprice.readwhen MAX renders the invoice PDF itself.
Errors
VALIDATIONwith reasonTEMPLATE_ERRORwhen a part does not parse or render, as at send.NOT_FOUND(fieldcode) when the template does not exist.NOT_FOUNDorVALIDATION(fieldresource) for theresource, as insendEmail.
Good to know
- Without a
resource, a template written for a kind of record renders fixed, fictitious sample data. - Costs 10 points plus its selection.
Arguments
input:PreviewEmailTemplateInput!· required
Returns
Example
Query
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.