Appearance
POST
/communication/template-text/template-texts/{id}/copyRequired scope:
templatetext:createCreates a copy of the template under a new template code. The copy is always created with status = 'draft'. Settings, locales, translations, subjects, country settings and attachments (with new ids) are duplicated; history is not. A single history entry is appended to the copy.
Request body ​
JSON
{
"newTemplateCode": "order-confirmation-copy"
}
Response ​
The copy was created successfully.
JSON
{
"templateCode": "order-confirmation",
"canonicalBody": "<p>{t_greeting} {customerName}</p>",
"countries": [
"FI",
"NO"
],
"sourceLocale": "sv",
"locales": [
"sv",
"en"
],
"translations": {
"sv": {
"t_greeting": "Hej"
}
},
"subjects": {
"sv": "Din order"
},
"senderNames": {
"sv": "Viskan"
},
"senderEmails": {
"sv": "no-reply@viskan.se"
},
"bccs": {
"sv": "archive@viskan.se"
},
"ccs": {
"sv": "sales@viskan.se"
},
"countrySettings": {
"FI": {
"senderName": "Viskan Finland",
"senderEmail": "no-reply@viskan.fi",
"cc": "",
"subjects": {
"sv": "Din order i Finland"
}
}
},
"settings": {
"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
},
"attachments": {
}
}
| Error code | Description |
|---|---|
invalid-request | newTemplateCode must not be null or blank. |
invalid-template-code | templateCode does not start with a letter or a digit, or has a character other than a letter, a digit, an underscore or a hyphen. |
invalid-template-code-length | templateCode is longer than 30 characters. |
template-code-already-exists | The requested newTemplateCode already exists in either the sidecar or the legacy notificationtemplate table. |
template-not-found | No template with the given source code exists for the current company. |