Skip to content

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 ​

FieldRequiredTypeDescription
title✅stringTemplate name
template✅object[]Email message template for the constructor.
plain_text❌string[]Email template for plain text message
subject✅string[]Email subject
email_from❌emailSender email. If not specified, global setting is used
email_from_name❌stringSender 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