CMS · email templates
7 routes. Paths are relative to https://api.intersink.com/v1.
- GET/cms/channels/{channelId}/email-templatesList the channel's email templates
- POST/cms/channels/{channelId}/email-templatesCreate an email template (key unique per channel)
- GET/cms/channels/{channelId}/email-templates/{id}Get an email template
- PATCH/cms/channels/{channelId}/email-templates/{id}Update an email template (incl. status)
- DELETE/cms/channels/{channelId}/email-templates/{id}Delete an email template
- POST/cms/channels/{channelId}/email-templates/{id}/previewRender with sample variables → {subject, html, text, missing}. {{x}} is HTML-escaped
- GET/cms/channels/{channelId}/email-templates/systemEmails sent on the channel's behalf (sign-in codes, invites, notifications) with their built-in copy, and whether the channel customised each
List the channel's email templates
GET/cms/channels/{channelId}/email-templates
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| page | number, query | Minimum 1. |
| limit | number, query | Minimum 1, maximum 100. |
| status | string, query | One of: "draft", "published", "archived". |
| q | string, query | Search in the title/name |
Response
200. The payload in data is not described in the spec yet.
Create an email template (key unique per channel)
POST/cms/channels/{channelId}/email-templates
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| category | string | At most 60 characters. Example: "Transactional" |
| body_text | string | Plain-text alternative body ({{var}} placeholders) At most 50000 characters. |
| variables | string[] | Documented variables (informational; used by preview) |
| keyrequired | string | Unique per channel At most 80 characters. Example: "order-confirmation" |
| namerequired | string | At most 120 characters. Example: "Order confirmation" |
| subjectrequired | string | At most 255 characters. Example: "Your order {{order_id}} is confirmed" |
| body_htmlrequired | string | HTML body. Sanitized server-side; {{var}} is HTML-escaped At most 100000 characters. |
| status | string | One of: "draft", "published". |
Response
201. The payload in data is of type object.
Get an email template
GET/cms/channels/{channelId}/email-templates/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Response
200. The payload in data is of type object.
Update an email template (incl. status)
PATCH/cms/channels/{channelId}/email-templates/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| category | string | At most 60 characters. Example: "Transactional" |
| body_text | string | Plain-text alternative body ({{var}} placeholders) At most 50000 characters. |
| variables | string[] | Documented variables (informational; used by preview) |
| key | string | At most 80 characters. Example: "order-confirmation" |
| name | string | At most 120 characters. |
| subject | string | At most 255 characters. |
| body_html | string | At most 100000 characters. |
| status | string | One of: "draft", "published", "archived". |
Response
200. The payload in data is of type object.
Delete an email template
DELETE/cms/channels/{channelId}/email-templates/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Render with sample variables → {subject, html, text, missing}. {{x}} is HTML-escaped
POST/cms/channels/{channelId}/email-templates/{id}/preview
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| variables | object | Sample values (max 16 KB). {{x}} is escaped in HTML. |
Response
200. The payload in data is of type object.
Emails sent on the channel's behalf (sign-in codes, invites, notifications) with their built-in copy, and whether the channel customised each
GET/cms/channels/{channelId}/email-templates/system
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path |
Response
200. The payload in data is not described in the spec yet.