mutation CreateEmailTemplate($input: EmailTemplateInput!) {
CreateEmailTemplate(input: $input) {
id
label
document_type
default
active
body
to
cc
bcc
object
created_at
updated_at
}
}
{
"input": {
"label": "Invoice Payment Reminder",
"document_type": "invoice",
"default": false,
"active": true,
"body": "Dear {{customer_name}},\n\nThis is a reminder that payment for invoice {{invoice_number}} is overdue.\n\nAmount due: {{total_amount}}\nDue date: {{due_date}}\n\nPlease make payment as soon as possible.\n\nBest regards,\n{{company_name}}",
"object": "Payment Reminder - Invoice {{invoice_number}}",
"to": ["{{customer_email}}"],
"cc": ["[email protected]"]
}
}
{
"data": {
"CreateEmailTemplate": {
"id": 100003,
"label": "Invoice Payment Reminder",
"document_type": "invoice",
"default": false,
"active": true,
"body": "Dear {{customer_name}},\n\nThis is a reminder that payment for invoice {{invoice_number}} is overdue.\n\nAmount due: {{total_amount}}\nDue date: {{due_date}}\n\nPlease make payment as soon as possible.\n\nBest regards,\n{{company_name}}",
"object": "Payment Reminder - Invoice {{invoice_number}}",
"to": ["{{customer_email}}"],
"cc": ["[email protected]"],
"bcc": [],
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
}
}
mutation UpdateEmailTemplate($id: ID!, $input: EmailTemplateInput!) {
UpdateEmailTemplate(id: $id, input: $input) {
id
label
document_type
default
active
body
object
to
cc
bcc
updated_at
}
}
{
"id": 100003,
"input": {
"label": "Urgent Payment Reminder",
"body": "URGENT: Payment for invoice {{invoice_number}} is now {{days_overdue}} days overdue.\n\nAmount due: {{total_amount}}\nDue date: {{due_date}}\n\nPlease make payment immediately to avoid further action.\n\nBest regards,\n{{company_name}}",
"object": "URGENT: Payment Reminder - Invoice {{invoice_number}}"
}
}
{
"data": {
"UpdateEmailTemplate": {
"id": 100003,
"label": "Urgent Payment Reminder",
"document_type": "invoice",
"default": false,
"active": true,
"body": "URGENT: Payment for invoice {{invoice_number}} is now {{days_overdue}} days overdue.\n\nAmount due: {{total_amount}}\nDue date: {{due_date}}\n\nPlease make payment immediately to avoid further action.\n\nBest regards,\n{{company_name}}",
"object": "URGENT: Payment Reminder - Invoice {{invoice_number}}",
"to": ["{{customer_email}}"],
"cc": ["[email protected]"],
"bcc": [],
"updated_at": "2025-01-15T11:00:00Z"
}
}
}
mutation GenerateEmailTemplate($id: ID!, $documentId: ID!) {
GenerateEmailTemplate(id: $id, documentId: $documentId) {
id
label
body
object
to
cc
bcc
}
}
{
"id": 100003,
"documentId": 200045
}
{
"data": {
"GenerateEmailTemplate": {
"id": 100003,
"label": "Urgent Payment Reminder",
"body": "URGENT: Payment for invoice INV-2025-001 is now 15 days overdue.\n\nAmount due: €1,250.00\nDue date: 2025-01-01\n\nPlease make payment immediately to avoid further action.\n\nBest regards,\nAcme Corp",
"object": "URGENT: Payment Reminder - Invoice INV-2025-001",
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": []
}
}
}