{
    "document": {
        "mail": {
            "entity": "document",
            "channel": "mail",
            "syntax": "{{group.field}} or {{group.field|filter}}; filters: date, money, upper, default",
            "groups": [
                {
                    "group": "document",
                    "fields": [
                        {
                            "path": "document.id",
                            "description": "The document's internal id.",
                            "markup": false
                        },
                        {
                            "path": "document.type_id",
                            "description": "The document type's id (3 is a tax invoice, 8 a receipt...).",
                            "markup": false
                        },
                        {
                            "path": "document.type_name",
                            "description": "The document type's name, in the template's language (\"Tax Invoice\").",
                            "markup": false
                        },
                        {
                            "path": "document.number",
                            "description": "The document number.",
                            "markup": false
                        },
                        {
                            "path": "document.issue_date",
                            "description": "The issue date (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "document.due_date",
                            "description": "The due date (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "document.reference",
                            "description": "The customer's own reference (their order number).",
                            "markup": false
                        },
                        {
                            "path": "document.currency",
                            "description": "The document's currency code (ILS, USD...).",
                            "markup": false
                        },
                        {
                            "path": "document.currency_rate",
                            "description": "The exchange rate the document was issued at.",
                            "markup": false
                        },
                        {
                            "path": "document.comments",
                            "description": "The document's internal note, as plain text. Staff only: never printed.",
                            "markup": false
                        },
                        {
                            "path": "document.description",
                            "description": "The document's remarks (the notes printed on it), as plain text.",
                            "markup": false
                        },
                        {
                            "path": "document.copy_label",
                            "description": "Source or Certified Copy, as the print shows it.",
                            "markup": false
                        },
                        {
                            "path": "document.allocation_number",
                            "description": "The tax authority allocation number, when the invoice has one.",
                            "markup": false
                        },
                        {
                            "path": "document.language",
                            "description": "The document's print language (he_il, en_us...).",
                            "markup": false
                        },
                        {
                            "path": "document.status",
                            "description": "The document status's name.",
                            "markup": false
                        },
                        {
                            "path": "document.sales_rep",
                            "description": "The name of the user the document belongs to.",
                            "markup": false
                        },
                        {
                            "path": "document.account_balance",
                            "description": "The customer's balance, as the print shows it.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "recipient",
                    "fields": [
                        {
                            "path": "recipient.name",
                            "description": "The customer's (or supplier's) name on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.vat_number",
                            "description": "The recipient's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "recipient.address",
                            "description": "The recipient's address on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.shipping_address",
                            "description": "The shipping address, when the document has one.",
                            "markup": false
                        },
                        {
                            "path": "recipient.phone",
                            "description": "The recipient's phone number on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.email",
                            "description": "The recipient's e-mail address on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.contact",
                            "description": "The contact person on the document.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "company",
                    "fields": [
                        {
                            "path": "company.name",
                            "description": "Your company's name.",
                            "markup": false
                        },
                        {
                            "path": "company.vat_number",
                            "description": "Your company's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "company.address",
                            "description": "Your company's address.",
                            "markup": false
                        },
                        {
                            "path": "company.phone",
                            "description": "Your company's phone number.",
                            "markup": false
                        },
                        {
                            "path": "company.fax",
                            "description": "Your company's fax number.",
                            "markup": false
                        },
                        {
                            "path": "company.email",
                            "description": "Your company's e-mail address (the reply-to setting).",
                            "markup": false
                        },
                        {
                            "path": "company.website",
                            "description": "Your company's website.",
                            "markup": false
                        },
                        {
                            "path": "company.logo",
                            "description": "Your company's logo: an image in a mail, its address in an SMS.",
                            "markup": true
                        }
                    ]
                },
                {
                    "group": "totals",
                    "fields": [
                        {
                            "path": "totals.subtotal",
                            "description": "The total of the lines before the document discount (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.discount",
                            "description": "The document discount (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.exempt",
                            "description": "The VAT-exempt part (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.taxable",
                            "description": "The part VAT is charged on (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.vat_by_rate",
                            "description": "The VAT split by rate, one row per rate, as the print shows it.",
                            "markup": false
                        },
                        {
                            "path": "totals.vat",
                            "description": "The VAT (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.rounding",
                            "description": "The rounding (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.total",
                            "description": "The total to pay, VAT included (add |money for the currency symbol).",
                            "markup": false
                        },
                        {
                            "path": "totals.local_currency_total",
                            "description": "The total in your currency, on a document in another currency (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.qty_sum",
                            "description": "The quantity of all the lines together.",
                            "markup": false
                        },
                        {
                            "path": "totals.paid",
                            "description": "What was paid on the document (add |money).",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "links",
                    "fields": [
                        {
                            "path": "links.document",
                            "description": "A link to the document's PDF.",
                            "markup": false
                        },
                        {
                            "path": "links.document_short",
                            "description": "A short link to the document's PDF (for an SMS).",
                            "markup": false
                        },
                        {
                            "path": "links.pay",
                            "description": "A link to the payment page, on a document that can be paid; empty otherwise.",
                            "markup": false
                        },
                        {
                            "path": "links.pay_short",
                            "description": "A short link to the payment page (for an SMS); empty when it cannot be paid.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "lines",
                    "fields": [
                        {
                            "path": "lines.table",
                            "description": "The document's lines as a table: the item (and its SKU), the quantity and the line total with VAT.",
                            "markup": true
                        }
                    ]
                }
            ],
            "legacy": {
                "docnum": "{{document.number}}",
                "company": "{{recipient.name}}",
                "vatnum": "{{recipient.vat_number}}",
                "email": "{{recipient.email}}",
                "phone": "{{recipient.phone}}",
                "refnum_ext": "{{document.reference}}",
                "issue_date": "{{document.issue_date|date}}",
                "due_date": "{{document.due_date|date}}",
                "comments": "{{document.comments}}",
                "description": "{{document.description}}",
                "currency_id": "{{document.currency}}",
                "docTypeName": "{{document.type_name}}",
                "docLink": "{{links.document}}",
                "shortDocLink": "{{links.document_short}}",
                "docPayLink": "{{links.pay}}",
                "shortDocPayLink": "{{links.pay_short}}",
                "companyName": "{{company.name}}",
                "companyLogo": "{{company.logo}}",
                "companyPhone": "{{company.phone}}",
                "companyEmail": "{{company.email}}",
                "companyWebsite": "{{company.website}}",
                "companyAddress": "{{company.address}}",
                "docLines": "{{lines.table}}",
                "totalPrint": "{{totals.total|money}}",
                "vatPrint": "{{totals.vat|money}}",
                "discountPrint": "{{totals.discount|money}}"
            }
        },
        "sms": {
            "entity": "document",
            "channel": "sms",
            "syntax": "{{group.field}} or {{group.field|filter}}; filters: date, money, upper, default",
            "groups": [
                {
                    "group": "document",
                    "fields": [
                        {
                            "path": "document.id",
                            "description": "The document's internal id.",
                            "markup": false
                        },
                        {
                            "path": "document.type_id",
                            "description": "The document type's id (3 is a tax invoice, 8 a receipt...).",
                            "markup": false
                        },
                        {
                            "path": "document.type_name",
                            "description": "The document type's name, in the template's language (\"Tax Invoice\").",
                            "markup": false
                        },
                        {
                            "path": "document.number",
                            "description": "The document number.",
                            "markup": false
                        },
                        {
                            "path": "document.issue_date",
                            "description": "The issue date (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "document.due_date",
                            "description": "The due date (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "document.reference",
                            "description": "The customer's own reference (their order number).",
                            "markup": false
                        },
                        {
                            "path": "document.currency",
                            "description": "The document's currency code (ILS, USD...).",
                            "markup": false
                        },
                        {
                            "path": "document.currency_rate",
                            "description": "The exchange rate the document was issued at.",
                            "markup": false
                        },
                        {
                            "path": "document.comments",
                            "description": "The document's internal note, as plain text. Staff only: never printed.",
                            "markup": false
                        },
                        {
                            "path": "document.description",
                            "description": "The document's remarks (the notes printed on it), as plain text.",
                            "markup": false
                        },
                        {
                            "path": "document.copy_label",
                            "description": "Source or Certified Copy, as the print shows it.",
                            "markup": false
                        },
                        {
                            "path": "document.allocation_number",
                            "description": "The tax authority allocation number, when the invoice has one.",
                            "markup": false
                        },
                        {
                            "path": "document.language",
                            "description": "The document's print language (he_il, en_us...).",
                            "markup": false
                        },
                        {
                            "path": "document.status",
                            "description": "The document status's name.",
                            "markup": false
                        },
                        {
                            "path": "document.sales_rep",
                            "description": "The name of the user the document belongs to.",
                            "markup": false
                        },
                        {
                            "path": "document.account_balance",
                            "description": "The customer's balance, as the print shows it.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "recipient",
                    "fields": [
                        {
                            "path": "recipient.name",
                            "description": "The customer's (or supplier's) name on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.vat_number",
                            "description": "The recipient's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "recipient.address",
                            "description": "The recipient's address on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.shipping_address",
                            "description": "The shipping address, when the document has one.",
                            "markup": false
                        },
                        {
                            "path": "recipient.phone",
                            "description": "The recipient's phone number on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.email",
                            "description": "The recipient's e-mail address on the document.",
                            "markup": false
                        },
                        {
                            "path": "recipient.contact",
                            "description": "The contact person on the document.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "company",
                    "fields": [
                        {
                            "path": "company.name",
                            "description": "Your company's name.",
                            "markup": false
                        },
                        {
                            "path": "company.vat_number",
                            "description": "Your company's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "company.address",
                            "description": "Your company's address.",
                            "markup": false
                        },
                        {
                            "path": "company.phone",
                            "description": "Your company's phone number.",
                            "markup": false
                        },
                        {
                            "path": "company.fax",
                            "description": "Your company's fax number.",
                            "markup": false
                        },
                        {
                            "path": "company.email",
                            "description": "Your company's e-mail address (the reply-to setting).",
                            "markup": false
                        },
                        {
                            "path": "company.website",
                            "description": "Your company's website.",
                            "markup": false
                        },
                        {
                            "path": "company.logo",
                            "description": "Your company's logo: an image in a mail, its address in an SMS.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "totals",
                    "fields": [
                        {
                            "path": "totals.subtotal",
                            "description": "The total of the lines before the document discount (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.discount",
                            "description": "The document discount (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.exempt",
                            "description": "The VAT-exempt part (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.taxable",
                            "description": "The part VAT is charged on (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.vat_by_rate",
                            "description": "The VAT split by rate, one row per rate, as the print shows it.",
                            "markup": false
                        },
                        {
                            "path": "totals.vat",
                            "description": "The VAT (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.rounding",
                            "description": "The rounding (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.total",
                            "description": "The total to pay, VAT included (add |money for the currency symbol).",
                            "markup": false
                        },
                        {
                            "path": "totals.local_currency_total",
                            "description": "The total in your currency, on a document in another currency (add |money).",
                            "markup": false
                        },
                        {
                            "path": "totals.qty_sum",
                            "description": "The quantity of all the lines together.",
                            "markup": false
                        },
                        {
                            "path": "totals.paid",
                            "description": "What was paid on the document (add |money).",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "links",
                    "fields": [
                        {
                            "path": "links.document",
                            "description": "A link to the document's PDF.",
                            "markup": false
                        },
                        {
                            "path": "links.document_short",
                            "description": "A short link to the document's PDF (for an SMS).",
                            "markup": false
                        },
                        {
                            "path": "links.pay",
                            "description": "A link to the payment page, on a document that can be paid; empty otherwise.",
                            "markup": false
                        },
                        {
                            "path": "links.pay_short",
                            "description": "A short link to the payment page (for an SMS); empty when it cannot be paid.",
                            "markup": false
                        }
                    ]
                }
            ],
            "legacy": {
                "docnum": "{{document.number}}",
                "company": "{{recipient.name}}",
                "vatnum": "{{recipient.vat_number}}",
                "email": "{{recipient.email}}",
                "phone": "{{recipient.phone}}",
                "refnum_ext": "{{document.reference}}",
                "issue_date": "{{document.issue_date|date}}",
                "due_date": "{{document.due_date|date}}",
                "comments": "{{document.comments}}",
                "description": "{{document.description}}",
                "currency_id": "{{document.currency}}",
                "docTypeName": "{{document.type_name}}",
                "docLink": "{{links.document}}",
                "shortDocLink": "{{links.document_short}}",
                "docPayLink": "{{links.pay}}",
                "shortDocPayLink": "{{links.pay_short}}",
                "companyName": "{{company.name}}",
                "companyLogo": "{{company.logo}}",
                "companyPhone": "{{company.phone}}",
                "companyEmail": "{{company.email}}",
                "companyWebsite": "{{company.website}}",
                "companyAddress": "{{company.address}}",
                "totalPrint": "{{totals.total|money}}",
                "vatPrint": "{{totals.vat|money}}",
                "discountPrint": "{{totals.discount|money}}"
            }
        }
    },
    "service": {
        "mail": {
            "entity": "service",
            "channel": "mail",
            "syntax": "{{group.field}} or {{group.field|filter}}; filters: date, money, upper, default",
            "groups": [
                {
                    "group": "service",
                    "fields": [
                        {
                            "path": "service.number",
                            "description": "The service call's number.",
                            "markup": false
                        },
                        {
                            "path": "service.status",
                            "description": "The service call status's name.",
                            "markup": false
                        },
                        {
                            "path": "service.type",
                            "description": "The service call type's name.",
                            "markup": false
                        },
                        {
                            "path": "service.description",
                            "description": "The fault or request, as written when the call was opened.",
                            "markup": false
                        },
                        {
                            "path": "service.work_description",
                            "description": "What was done, as the technician wrote it.",
                            "markup": false
                        },
                        {
                            "path": "service.opened",
                            "description": "When the call was opened (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "service.start_time",
                            "description": "When the work started.",
                            "markup": false
                        },
                        {
                            "path": "service.end_time",
                            "description": "When the work ended.",
                            "markup": false
                        },
                        {
                            "path": "service.reference",
                            "description": "The customer's own reference for the call.",
                            "markup": false
                        },
                        {
                            "path": "service.machine",
                            "description": "The name of the machine the call is about.",
                            "markup": false
                        },
                        {
                            "path": "service.technician",
                            "description": "The name of the user the call is assigned to.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "customer",
                    "fields": [
                        {
                            "path": "customer.name",
                            "description": "The customer's name.",
                            "markup": false
                        },
                        {
                            "path": "customer.phone",
                            "description": "The customer's phone number.",
                            "markup": false
                        },
                        {
                            "path": "customer.email",
                            "description": "The customer's e-mail address.",
                            "markup": false
                        },
                        {
                            "path": "customer.address",
                            "description": "The customer's address.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "company",
                    "fields": [
                        {
                            "path": "company.name",
                            "description": "Your company's name.",
                            "markup": false
                        },
                        {
                            "path": "company.vat_number",
                            "description": "Your company's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "company.address",
                            "description": "Your company's address.",
                            "markup": false
                        },
                        {
                            "path": "company.phone",
                            "description": "Your company's phone number.",
                            "markup": false
                        },
                        {
                            "path": "company.fax",
                            "description": "Your company's fax number.",
                            "markup": false
                        },
                        {
                            "path": "company.email",
                            "description": "Your company's e-mail address (the reply-to setting).",
                            "markup": false
                        },
                        {
                            "path": "company.website",
                            "description": "Your company's website.",
                            "markup": false
                        },
                        {
                            "path": "company.logo",
                            "description": "Your company's logo: an image in a mail, its address in an SMS.",
                            "markup": true
                        }
                    ]
                }
            ],
            "legacy": {}
        },
        "sms": {
            "entity": "service",
            "channel": "sms",
            "syntax": "{{group.field}} or {{group.field|filter}}; filters: date, money, upper, default",
            "groups": [
                {
                    "group": "service",
                    "fields": [
                        {
                            "path": "service.number",
                            "description": "The service call's number.",
                            "markup": false
                        },
                        {
                            "path": "service.status",
                            "description": "The service call status's name.",
                            "markup": false
                        },
                        {
                            "path": "service.type",
                            "description": "The service call type's name.",
                            "markup": false
                        },
                        {
                            "path": "service.description",
                            "description": "The fault or request, as written when the call was opened.",
                            "markup": false
                        },
                        {
                            "path": "service.work_description",
                            "description": "What was done, as the technician wrote it.",
                            "markup": false
                        },
                        {
                            "path": "service.opened",
                            "description": "When the call was opened (add |date for the company's date format).",
                            "markup": false
                        },
                        {
                            "path": "service.start_time",
                            "description": "When the work started.",
                            "markup": false
                        },
                        {
                            "path": "service.end_time",
                            "description": "When the work ended.",
                            "markup": false
                        },
                        {
                            "path": "service.reference",
                            "description": "The customer's own reference for the call.",
                            "markup": false
                        },
                        {
                            "path": "service.machine",
                            "description": "The name of the machine the call is about.",
                            "markup": false
                        },
                        {
                            "path": "service.technician",
                            "description": "The name of the user the call is assigned to.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "customer",
                    "fields": [
                        {
                            "path": "customer.name",
                            "description": "The customer's name.",
                            "markup": false
                        },
                        {
                            "path": "customer.phone",
                            "description": "The customer's phone number.",
                            "markup": false
                        },
                        {
                            "path": "customer.email",
                            "description": "The customer's e-mail address.",
                            "markup": false
                        },
                        {
                            "path": "customer.address",
                            "description": "The customer's address.",
                            "markup": false
                        }
                    ]
                },
                {
                    "group": "company",
                    "fields": [
                        {
                            "path": "company.name",
                            "description": "Your company's name.",
                            "markup": false
                        },
                        {
                            "path": "company.vat_number",
                            "description": "Your company's VAT or company number.",
                            "markup": false
                        },
                        {
                            "path": "company.address",
                            "description": "Your company's address.",
                            "markup": false
                        },
                        {
                            "path": "company.phone",
                            "description": "Your company's phone number.",
                            "markup": false
                        },
                        {
                            "path": "company.fax",
                            "description": "Your company's fax number.",
                            "markup": false
                        },
                        {
                            "path": "company.email",
                            "description": "Your company's e-mail address (the reply-to setting).",
                            "markup": false
                        },
                        {
                            "path": "company.website",
                            "description": "Your company's website.",
                            "markup": false
                        },
                        {
                            "path": "company.logo",
                            "description": "Your company's logo: an image in a mail, its address in an SMS.",
                            "markup": false
                        }
                    ]
                }
            ],
            "legacy": {}
        }
    }
}
