Access email templates for automated communications.
GraphQL
query GetEmailTemplate($id: ID) {
EmailTemplate(id: $id) {
id
label
document_type
default
active
body
to
cc
bcc
object
files { id }
created_at
updated_at
deleted_at
}
}
GraphQL
query EmailTemplates(
$where: QueryEmailTemplatesWhereWhereConditions,
$orderBy: [QueryEmailTemplatesOrderByOrderByClause!],
$search: String
) {
EmailTemplates(
where: $where
orderBy: $orderBy
search: $search
) {
id
label
document_type
active
default
object
created_at
updated_at
}
}
JSON
{
"where": {
"AND": [
{ "column": "ACTIVE", "operator": "EQ", "value": true }
]
},
"orderBy": [
{ "column": "LABEL", "order": "ASC" }
],
"search": "template name"
}
Field Type Description idInt Unique identifier of the email template. labelString Label of the email template. document_typeType Type of document (invoice, estimate, order, etc.). defaultBoolean Whether this is the default template for the document type. activeBoolean Whether the email template is active. bodyString Email body content. to[String] Default TO recipients. cc[String] Default CC recipients. bcc[String] Default BCC recipients. objectString Email subject line. files[File] Attached files. created_atDateTime Creation date. updated_atDateTime Last update date. deleted_atDateTime Deletion date (soft delete).
You can create filters based on following fields
id - Int Example: { "column": "ID", "operator": "EQ", "value": 100012 }
label - String Example: { "column": "LABEL", "operator": "LIKE", "value": "%invoice%" }
document_type - Type Example: { "column": "DOCUMENT_TYPE", "operator": "EQ", "value": "invoice" }
active - Boolean Example: { "column": "ACTIVE", "operator": "EQ", "value": true }
default - Boolean Example: { "column": "DEFAULT", "operator": "EQ", "value": true }
You can sort data based on following fields: label, active, default, document_type
GraphQL
query SortEmailTemplates(
$where: QueryEmailTemplatesWhereWhereConditions
) {
EmailTemplates(
where: $where
orderBy: [{ column: LABEL, order: ASC }]
) {
id
label
document_type
active
default
object
}
}
JSON
{
"data": {
"EmailTemplates": [
{
"id": 100001,
"label": "Invoice Reminder",
"document_type": "invoice",
"active": true,
"default": true,
"object": "Payment Reminder - Invoice {{invoice_number}}",
"created_at": "2025-01-01T09:00:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
{
"id": 100002,
"label": "Order Confirmation",
"document_type": "order",
"active": true,
"default": false,
"object": "Order Confirmation - {{order_number}}",
"created_at": "2025-01-01T09:00:00Z",
"updated_at": "2025-01-01T09:00:00Z"
}
]
}
}
Value Description invoiceInvoice document. estimateEstimate/quote document. orderSales order document. shipping_orderShipping order document. credit_noteCredit note document. purchasePurchase order document. purchase_receiptPurchase receipt document. product_returnProduct return document. deliveryDelivery document. refundRefund document. stock_adjustmentStock adjustment document. stock_entryStock entry document. stock_removalStock removal document. stock_transferStock transfer document. subscriptionSubscription document. b2b_storeB2B store document.
Value Description emailTemplateFilesFiles attached to the email template.