Message templates tools
All tool areas. Each tool acts within your access.
Message templates
list_message_templates
List every message Lokl sends, with its subject and editable words as they are at one level, where each value comes from (Lokl's own text, the organization's, or an entity's: an entity's beats the organization's, which beats Lokl's), what {{variables}} the text may use, and what Lokl always writes itself. Pass entityId for the text an entity's guests get, or nothing for the organization's own. Messages to staff and the kitchen can't be edited and are listed as such. Use before update_message_template.
Reads · Members of an organization · Needs settings:read
Input
entityIdBrand the message for this entity: its text beats the organization's. Leave out to read or change the organization's own
localeThe language the text is written in. Only en for now
Output
levelnameThe organization's or the entity's name
localetemplatestemplates[]templates[].notificationThe message's key, as list_message_templates names it
templates[].nametemplates[].descriptionWhen it's sent, and to whom
templates[].audiencetemplates[].editabletemplates[].reasonWhy it can't be edited, when it can't; null otherwise
templates[].aboutWhat it's about. Only a message about an order can be previewed against a real booking; the rest use a sample
templates[].subjectThe subject, or null where it can't be changed (it says what happened) or the message can't be edited
templates[].subject.valueThe text in effect at this level, in the format blocks are written in
templates[].subject.defaultLokl's own text
templates[].subject.inheritedWhat it would be if this level's own text were taken away: Lokl's own for the organization, and the organization's (or Lokl's) for an entity
templates[].subject.sourcetemplates[].subject.source.levelWhere the text comes from: Lokl's own (default), the organization's, or the entity's
templates[].subject.source.idThe saved template it comes from (mtp_…); null for Lokl's own
templates[].subject.overriddenHereWhether this level has text of its own for it
templates[].blocksThe editable words, in the order they appear in the email
templates[].blocks[]templates[].blocks[].valueThe text in effect at this level, in the format blocks are written in
templates[].blocks[].defaultLokl's own text
templates[].blocks[].inheritedWhat it would be if this level's own text were taken away: Lokl's own for the organization, and the organization's (or Lokl's) for an entity
templates[].blocks[].sourcetemplates[].blocks[].source.levelWhere the text comes from: Lokl's own (default), the organization's, or the entity's
templates[].blocks[].source.idThe saved template it comes from (mtp_…); null for Lokl's own
templates[].blocks[].overriddenHereWhether this level has text of its own for it
templates[].blocks[].keyThe block's key, as update_message_template takes it
templates[].blocks[].labeltemplates[].blocks[].descriptiontemplates[].blocks[].formatline: one plain line (a heading, a greeting). paragraphs: paragraphs separated by a blank line, with **bold** and [links](https://…)
templates[].blocks[].requiredA required block can't be left empty
templates[].variablesWhat {{variables}} the subject and the blocks may use
templates[].variables[]templates[].variables[].nameWrite it in the text as {{name}}
templates[].variables[].descriptiontemplates[].variables[].exampleWhat it looks like filled in
templates[].fixedWhat Lokl always writes itself in this message, which can't be changed or taken out
templates[].fixed[]templates[].updatedAtWhen this level's text was last saved; null if it has none
render_message_template
See a message as a guest would get it: its subject, HTML, and plain text, written from the text saved at this level (the entity's, else the organization's, else Lokl's) with a draft laid over it to try new words before saving them. With orderId it uses that booking's real details (a booking you may see in full: its guest's name and what they paid); a message about something else, or none, uses a built-in sample. Links in a preview are placeholders that open nothing. Changes nothing; send_test_message emails it to you.
Reads · Members of an organization · Needs settings:read
Input
notificationThe message's key, as list_message_templates names it
entityIdBrand the message for this entity: its text beats the organization's. Leave out to read or change the organization's own
localeThe language the text is written in. Only en for now
orderIdWrite it from this booking. Only for a message about a booking
draftText to try over what's saved at this level (a JSON object in the query string):
subject, andblocksby key; null tries what the level inheritsdraft.subjectThe subject to try, or null to try the text this level inherits
draft.blocksText to try for each block by its key, or null to try what this level inherits
draft.blocks.*
Output
notificationsubjecthtmltextsourceWhether it was written from the booking you named or the sample
bookingCodenote
send_test_message
Email yourself a message as guests would get it, to see it in a real inbox: written from the text saved at this level with an optional draft laid over it, and from a booking's details with orderId (a booking you may see in full) or the built-in sample. It goes only to your own address, with "[Test]" in front of the subject, through the email queue. Links in it are placeholders that open nothing. Up to 20 an hour. Can't be undone. Returns a preview to confirm.
Changes · Members of an organization · Needs settings:write
Input
notificationThe message's key, as list_message_templates names it
entityIdBrand the message for this entity: its text beats the organization's. Leave out to read or change the organization's own
localeThe language the text is written in. Only en for now
orderIdWrite it from this booking. Only for a message about a booking
draftText to try over what's saved at this level:
subject, andblocksby key; null tries what the level inheritsdraft.subjectThe subject to try, or null to try the text this level inherits
draft.blocksText to try for each block by its key, or null to try what this level inherits
draft.blocks.*
Output
notificationsentToYour own address
subjectThe subject it was sent with
update_message_template
Change the words of a message at one level: the organization's, or one entity's with entityId (branded per entity: it beats the organization's, which beats Lokl's). Set subject and any of the editable blocks by their key (list_message_templates gives them, with the {{variables}} each may use); write null to take this level's text away so it inherits again. Text is plain paragraphs separated by a blank line, with {{variable}} placeholders, **bold**, and [links](https://…) only; an unknown variable, HTML, or a link that isn't https is refused, naming it. Lokl's own parts of the message (the booking's details, totals, QR code, links, policies) can't be changed. Takes effect on the next message sent, reminders already scheduled included. Use render_message_template to try words first. Undo puts the text back while it hasn't been changed since. Returns a preview to confirm.
Changes · Members of an organization · Needs settings:write
Input
notificationThe message's key, as list_message_templates names it
entityIdBrand the message for this entity: its text beats the organization's. Leave out to read or change the organization's own
localeThe language the text is written in. Only en for now
subjectThe new subject, one line with {{variables}}, or null to take this level's own away. Leave out to keep it
blocksNew text by block key (headline, greeting, intro, closing, where the message has them), or null to take this level's own away. Leave a block out to keep it
blocks.*
Output
notificationThe message's key, as list_message_templates names it
namedescriptionWhen it's sent, and to whom
audienceeditablereasonWhy it can't be edited, when it can't; null otherwise
aboutWhat it's about. Only a message about an order can be previewed against a real booking; the rest use a sample
subjectThe subject, or null where it can't be changed (it says what happened) or the message can't be edited
subject.valueThe text in effect at this level, in the format blocks are written in
subject.defaultLokl's own text
subject.inheritedWhat it would be if this level's own text were taken away: Lokl's own for the organization, and the organization's (or Lokl's) for an entity
subject.sourcesubject.source.levelWhere the text comes from: Lokl's own (default), the organization's, or the entity's
subject.source.idThe saved template it comes from (mtp_…); null for Lokl's own
subject.overriddenHereWhether this level has text of its own for it
blocksThe editable words, in the order they appear in the email
blocks[]blocks[].valueThe text in effect at this level, in the format blocks are written in
blocks[].defaultLokl's own text
blocks[].inheritedWhat it would be if this level's own text were taken away: Lokl's own for the organization, and the organization's (or Lokl's) for an entity
blocks[].sourceblocks[].source.levelWhere the text comes from: Lokl's own (default), the organization's, or the entity's
blocks[].source.idThe saved template it comes from (mtp_…); null for Lokl's own
blocks[].overriddenHereWhether this level has text of its own for it
blocks[].keyThe block's key, as update_message_template takes it
blocks[].labelblocks[].descriptionblocks[].formatline: one plain line (a heading, a greeting). paragraphs: paragraphs separated by a blank line, with **bold** and [links](https://…)
blocks[].requiredA required block can't be left empty
variablesWhat {{variables}} the subject and the blocks may use
variables[]variables[].nameWrite it in the text as {{name}}
variables[].descriptionvariables[].exampleWhat it looks like filled in
fixedWhat Lokl always writes itself in this message, which can't be changed or taken out
fixed[]updatedAtWhen this level's text was last saved; null if it has none