Email Templates
All Templates
GET api/email-templates
Response:
json
{
"status": "ok",
"timestamp": 1684402652000,
"data": [
{
"id": 34,
"title": "Подтверждения email",
"channel": null,
"template": {
"ru": [
{
"type": "heading",
"data": "Подтверждения эл. почты"
},
{
"type": "paragraph",
"data": [
{
"type": "text",
"data": "Нажмите на ссылку, для подтверждения электронной почты"
}
]
},
{
"type": "button",
"data": {
"title": "Оформить заявку",
"link": "${verifyLink}"
}
}
]
},
"plain_text": null,
"subject": {
"ru": "Перейдите по ссылке для подтверждения эл. почты."
},
"email_from": null,
"email_from_name": null,
"deleted_at": null,
"created_at": null,
"updated_at": null
}
]
}Template by ID
GET api/email-templates/{id}
Add Template
POST api/email-templates
Request body: email template
Update Template
PUT api/email-templates/{id}
Request body: email template
Delete Template
DELETE api/email-templates/{id}
Email Template Object
| Field | Required | Type | Description |
|---|---|---|---|
| title | ✅ | string | Template name |
| template | ✅ | object[] | Email message template for the constructor. |
| plain_text | ❌ | string[] | Email template for plain text message |
| subject | ✅ | string[] | Email subject |
| email_from | ❌ | Sender email. If not specified, global setting is used | |
| email_from_name | ❌ | string | Sender name. If not specified, global setting is used |
TIP
Email templates and subject must be specified with language indication.
json
{
"template": {
"ru": "Шаблон сообщения на русском",
"en": "Message in english"
}
}To specify variables, use the ${variableName} signature