Appearance
POST
/communication/template-text/template-texts/{id}/test-sendRequired scope:
templatetext:updateRenders the template with the current dummy data (same source as GET /rendered) and inserts a row into dbo.mailtosend for mail-service to deliver. Does not check template status; does not append a history row. The country blocks are resolved for the country of the request, for all countries that no block names if the country is OTHER, or for the default country of the locale if it has none. The subject and the sender are those of the same country (the country setting, else the language), and no cc or bcc is written. Only email templates can be test-sent: SMS and invoicetext templates throw test-send-not-supported. An e-mail with the content type text/plain is written to mailtosend as text/plain.
Request body ​
JSON
{
"locale": "sv",
"toEmail": "john.doe@viskan.se",
"toName": "John Doe",
"country": "FI"
}
Response ​
The row was inserted; response contains the generated mail_id.
JSON
{
"mailId": 12345
}
| Error code | Description |
|---|---|
ambiguous-country | The requested country code matches more than one country in the company's country table. |
invalid-request | locale or toEmail is null or blank. |
locale-not-found | The requested locale is not defined for this template. |
missing-sender | Neither the template nor the company has a sender email configured; set senderEmails on the template before test-sending. |
template-not-found | No template with the given code exists for the current company. |
test-send-not-supported | Only email templates can be test-sent; SMS and invoicetext templates are not supported. |
unknown-country | The requested country is not in the company's country table. |