L Linet Developers
Home / Journeys / Writing the mail and SMS a document is sent with
Journey 07 · Message templatesPreview

Writing the mail and SMS a document is sent with

When Linet mails a document, or sends an SMS about a document or a service call, the text comes from a template. A template is plain text (an SMS, a mail subject) or HTML (a mail body) with placeholders that Linet fills in for the record. The placeholders are the print templates' own, so a field reads the same in a print, a mail and an SMS. You read and write templates through API v2, and a person edits the same thing on the template screens.

Preview. The {{group.field}} placeholders and the template API are new, and may still change. The old %column% placeholders keep working.

Which template is used

  • A mail belongs to a document type and a language. When a document is mailed, Linet takes the template of its type in its print language. The PDF is always attached.
  • An SMS belongs to what it is sent for, its entity_type_id: 10 a document (with entity_id the document type), 11 a document's payment request, or 80 a service call (chosen per service status).

Placeholders

A placeholder is {{group.field}}, or {{group.field|filter}} to format it: {{totals.total|money}}, {{document.due_date|date}}, {{recipient.name|upper}}, {{document.reference|default:"your order"}}. The syntax and the filters are exactly the print templates': see Print templates › Fields in text.

  • Escaped: in a mail body every value is inserted as text, never as HTML, so a customer name cannot break the mail. Two placeholders are HTML on purpose: {{lines.table}} and {{company.logo}}.
  • Links: a mail also fills placeholders inside a link's href: <a href="{{links.pay}}">Pay</a>. A links.* value goes in as it is, anything else is URL-encoded there.
  • Unknown: a placeholder or filter that does not exist prints nothing, and the API refuses to save it (422, naming it).
  • The old ones still work: templates written with %docnum%, %company%, %totalPrint% and the like print as before, and may be mixed with the new ones. The tables below show the new name for each old one.

Two examples

An SMS template for invoices, and what it sent for an invoice on a test company:

Invoice {{document.number}} from {{company.name}}: {{totals.total|money}}, due {{document.due_date|date}}. Pay: {{links.pay_short}}
Invoice 326810 from טסטינג: ₪ 100.00, due 29/10/2026. Pay: https://…

A mail template (subject, then body):

{{document.type_name}} {{document.number}} from {{company.name}}

<p>Hello {{recipient.name}},</p>
<p>Attached is {{document.type_name}} {{document.number}} of {{document.issue_date|date}}
   for <b>{{totals.total|money}}</b>.</p>
<p><a href="{{links.pay}}">Pay online</a></p>
חשבונית מס 326810 from טסטינג

Hello Test cred,
Attached is חשבונית מס 326810 of 29/10/2026 for ₪ 100.00.
Pay online (https://…)

The document type's name is in the document's print language, here Hebrew.

Every placeholder

The same list as GET /message-placeholders (placeholders.json).

Loading…

What survives in a mail body

A body is sanitised when it is saved and again when it is sent, for what mail clients show:

  • Inline style="" only: <style>, <head> and <script> are dropped.
  • Tables, bgcolor, width, align, dir and max-width survive. Use <span dir="ltr"> around numbers, phones and addresses in a right-to-left body.
  • No data: images: an image needs a public https address ({{company.logo}} is one).
  • border-radius and box-shadow survive; Outlook desktop ignores both.

Reading and writing them

CallDoes
GET/POST /mail-templates, GET/PATCH/DELETE /mail-templates/{id}a document's mail templates
POST /mail-templates/{id}/preview{"document_id": …}: the subject and body as they would be sent. Nothing is sent.
GET/POST /sms-templates, GET/PATCH/DELETE /sms-templates/{id}SMS templates
POST /sms-templates/{id}/preview{"document_id": …} or {"service_id": …}: the text, its length and how many messages it is sent as (160 characters each, 70 with Hebrew)
GET /message-placeholdersevery placeholder, described, and the old name each replaces

Scopes settings:read and settings:write, as for print templates. A preview never makes a PDF: links show as a placeholder address. The full reference: API v2 › Message templates.