Types of templates
There are two kinds of templates: EmailTemplates and DocumentTemplates.
Both templates share a set of common fields:
| Field | Description |
|---|---|
| ID | The ID of the template, UUID v7 format |
| Names | The display name of the template, per given language |
| Contents | A Handlebars template which outputs the HTML for the template, per given language |
| Custom Query | A custom GraphQL query that you can use to enrich the event payload data |
| Query variables | Variables used to execute the custom query. Supports Handlebars variables. The final result after rendering with Handlebars should be valid JSON. This is the only Handlebars field that is rendered only with the original event payload. Any other field with Handlebars support also includes the data fetched by the custom query |
EmailTemplates
Email templates send an email based on the event payload and can be linked directly to an Event Action.
Email templates include additional fields:
| Field | Description |
|---|---|
| Subject | The subject of the email, per given language. Supports Handlebars variables |
| From | The sender of the email. Consists of an email address and a name (the name can be translated into multiple languages) |
| Tos | An array of EmailContacts |
| Ccs | An array of EmailContacts |
| Bccs | An array of EmailContacts |
| Attachments | An array of document templates that will be rendered and attached as PDFs to the email |
EmailContact
| Field | Description |
|---|---|
| The email address of the contact. Supports Handlebars variables | |
| Name | (optional) The display name of the contact. Supports Handlebars variables |
DocumentTemplates
Document templates generate PDF documents based on the event payload. They can be added to an EmailTemplate as an attachment or generated from dedicated mutations like orderGetPDF and quoteGetPDF. These methods select the document template with isDefaultOrderPdf or isDefaultQuotePdf respectively.
| Field | Description |
|---|---|
| FileNames | The proposed file name for the generated PDF document, per given language. Used as the file name when attached to an EmailTemplate and can be used in the Content-Disposition header when loading the template in the frontend |
| isDefaultOrderPdf | Indicates this template will be used when generating an order PDF in the Propeller Backoffice or when calling the orderGetPDF mutation in the API |
| isDefaultQuotePdf | Indicates this template will be used when generating a quote PDF in the Propeller Backoffice or when calling the quoteGetPDF mutation in the API |