Preview template
Renders a template against a payload without publishing or sending anything — the console's live preview, and the way to see the email exactly as it will arrive. Pass the bodies inline to preview the editor's current contents, or omit them to render whatever is stored, draft first. An empty payload falls back to each variable's declared example, which is what makes a preview work before anybody has invented one. A kind with no template at all previews as empty rather than failing. Parse errors and missing required variables come back in error; variables the bodies reference but do not declare come back in undeclared, which is not an error but is usually a typo. Needs admin of the team that owns the app, or notify:platform:admin.
Required scopes: notify:templates:read
Authorization
BearerAuth An access token from Xeonr Auth, presented as
Authorization: Bearer <token>. Its audience must include
https://notify.xeonr.io, and it must carry the scope the method
lists.
In: header
Header Parameters
Define the version of the Connect protocol
1Define the timeout, in ms
Request Body
application/json
1 <= length <= 641 <= length <= 64Render this instead of the stored draft. The console sends the editor's current contents, so the preview tracks typing rather than the last save.
items <= 8items <= 64The values to render with. Empty uses each variable's declared example, which is what makes a preview work before anybody has invented a payload. validate:skip free-form render values; the version's declared variables are what bound them
Response Body
application/json
application/json
curl -X POST "https://notify.xeonr.io/xeonr.notify.v1.TemplateService/PreviewTemplate" \ -H "Connect-Protocol-Version: 1" \ -H "Content-Type: application/json" \ -d '{}'{
"renders": [
"map[body:Luke approved your request for Dune: Part Two. channel:CHANNEL_EMAIL html:<p>Luke approved your request for <b>Dune: Part Two</b>.</p> subject:[XMB] Dune: Part Two was approved title:Dune: Part Two was approved]"
],
"error": "template: missing required variable \"request_title\"",
"undeclared": [
"requester"
]
}List templates POST
Every template for an app, each with which version is published and whether an unpublished draft exists. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. Cursor-paginated: newest first, over an opaque cursor over `(created_at, id)`. `limit` is clamped to 500 (0 means the default of 50); pass `next_cursor` back as `cursor` for the next page. **Required scopes:** `notify:templates:read`
Publish template POST
Promotes the draft to live as a new immutable version. From here on, a publish naming this kind renders through it, and each message records the version it rendered so the delivery log can show what was sent even after the template moves on. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. **Required scopes:** `notify:templates:edit`