Skip to content

Apply operations to unsaved template

POST
/communication/template-text/template-texts/{id}/operations
Required scope: templatetext:update

Applies operations of the editor to content that has not been saved and returns the result, so the editor can change an e-mail by what it means (a text, a subject) instead of by its HTML. Nothing is stored: no write, no history entry, no projection. canonicalBody is required, because the element ids depend on it; every other content field is optional and a field that is left out uses the stored template, as in POST /rendered. The content is checked and cleaned exactly as a save does. The operations are applied in order to a copy, and either all are applied or the request is refused with the position of the operation and the reason. An empty list of operations returns the outline of the body. Only e-mails with HTML content have operations. The element ids are those of the sanitised body, as in a preview with withElementIds. baseRevision is required if an operation, focusId or detailIds has an element id, and must be the structureRevision of the body. The returned canonicalBody is cleaned like a save cleans it, not beautified: compare structureRevision and idMap, not strings. outline describes the elements of the body (at most about 15 kB; with focusId the part around that element in full), elements has the elements that the operations changed and those of detailIds with all attributes, results has a short summary of every operation, and findings is empty until the checker is available. Available operations: setText (key, language, value) and setSubject (language, value). remove, setStyle, setLink, setImage, setCountries and repair are refused with not-available-yet.

Request body ​

Response ​

The content after the operations, with the outline of the body.