Appearance
PATCH
/communication/template-text/template-texts/{id}/metaRequired scope:
templatetext:updateApplies a partial settings update to a template. Only non-null fields in the request are applied. Regenerates the notificationtemplate projection for all locales because sender, sendername, and recipientbcc are mirrored there. The country settings are not merged: when they are sent they replace the whole map, when they are left out the stored ones are kept.
Request body ​
JSON
{
"name": "Order confirmation",
"senderNames": {
"sv": "Viskan"
},
"senderEmails": {
"sv": "no-reply@viskan.se"
},
"bccs": {
"sv": "archive@viskan.se"
},
"ccs": {
"sv": "sales@viskan.se"
},
"countrySettings": {
"FI": {
"senderName": "Viskan Finland",
"subjects": {
"sv": "Din order i Finland"
}
}
},
"mediaEnv": "prod",
"editorType": "html",
"populateSource": 500,
"showInEditors": [
1099,
1056
],
"allLanguages": true
}
Response ​
The template meta was updated successfully.
JSON
{
"templateCode": "order-confirmation",
"name": "Order confirmation",
"channel": "email",
"contentType": "text/html",
"editorType": "html",
"mediaEnv": "prod",
"status": "active",
"templateType": 0,
"populateSource": 500,
"updatedAt": "2024-08-14T12:34:56.412",
"showInEditors": [
1099,
1056
],
"allLanguages": true
}
| Error code | Description |
|---|---|
ambiguous-country | A country of countrySettings is a country code that matches more than one country in the company's country table. |
country-block-in-subject | A subject of a country has a country block; country blocks are only allowed in the body. |
invalid-bcc | A bcc, also one of a country, has a control character (such as a line break), or is not an e-mail address or a list of them separated by ';' or ',' (empty means none). |
invalid-bcc-length | A bcc, also one of a country, is longer than 60 characters. |
invalid-cc | A cc, also one of a country, has a control character (such as a line break), or is not an e-mail address or a list of them separated by ';' or ',' (empty means none). |
invalid-cc-length | A cc, also one of a country, is longer than 60 characters. |
invalid-country-settings | A key of countrySettings is blank, OTHER or a country that is there twice, or a country has no settings object. |
invalid-populate-source | populateSource is not one of the populate sources from the populate-sources endpoint. |
invalid-sender-email | A sender email address, also one of a country, has a control character (such as a line break), or is not an e-mail address or a list of them separated by ';' or ',' (empty means none). |
invalid-sender-email-length | A sender email address, also one of a country, is longer than 60 characters. |
invalid-sender-name | A sender name, also one of a country, has a control character (such as a line break). |
invalid-sender-name-length | A sender name, also one of a country, is longer than 60 characters. |
invalid-show-in-editors | showInEditors has an id that is not greater than 0, an id that is there twice, or more than 50 ids. |
invalid-subject | A subject, also one of a country, has a control character (such as a line break) or is longer than 500 characters. |
invalid-template-name | The template name has a control character (such as a line break) or is longer than 200 characters. |
locale-not-found | A subject of a country is for a locale that the template does not have. |
not-supported-for-usage-type | The template is an invoicetext, which has no sender name, sender e-mail, cc, bcc or country settings, and the request has a value for one of them. |
template-changed | Another request changed the template after it was read, so nothing was saved. Reload the template and try again. |
template-not-found | No template with the given code exists for the current company. |
unknown-country | A country of countrySettings is not in the company's country table. |