Skip to main content

previewDocumentEmail

Requires permission settings:documents:read.

Render one document email template with sample data, using this org's brand, saved line-item columns, base currency and default language, applying an optional in-progress brand DRAFT. Persists nothing.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query PreviewDocumentEmail($type: String!) {
previewDocumentEmail(type: $type) {
type
html
locale
subject
templateVersion
}
}

Variables:

{
"type": "string"
}

Response:

{
"data": {
"previewDocumentEmail": {
"type": "string",
"html": "string",
"locale": "string",
"subject": "string",
"templateVersion": 0
}
}
}
previewDocumentEmail(
draft: DocumentEmailDraftInput
locale: String
type: String!
): DocumentEmailPreview!

Arguments​

previewDocumentEmail.draft ● DocumentEmailDraftInput input​

Unsaved edits to preview. Omit to preview the saved version.

previewDocumentEmail.locale ● String scalar​

The language of the email, as a locale code.

previewDocumentEmail.type ● String! non-null scalar​

The kind of document the email is for.

Type​

DocumentEmailPreview object​

A rendered sample of one outbound document email.