Skip to content

Render a block document

POST
/communication/template-text/blocks/render
Required scope: templatetext:read

Builds the body of an e-mail template from a block document, for the import of a mail and for the editor. Nothing is stored; it is stateless like POST /{id}/rendered. The document has the settings of the mail and sections of columns (with heading, text, image, divider and spacer items) or of html that is kept as it is. The texts are {t_*} keys with their source-language values in translations. The request is forgiving: it fixes what it safely can (a mail setting that is left out gets a default, colours to #RRGGBB, a block or formatting tag, a comment or a marker in a text, the markers and head elements of an html section, a font family without a generic family, an image that is wider than its column, a font link that is not allowed, a block tag in a text, a declaration of a style that a setStyle would refuse, the classes and the repairable findings of an html section, texts that nothing uses) and lists every fix in adjustments with the JSON pointer of the part of the document, and it refuses only what can not be made safe, with the pointer and a reason. The response has canonicalBody (a full HTML document, already cleaned, so it is what a save stores), translations (the texts that the body uses), the adjustments, findings (the checker on the result, with the data fields of the populate source) and preview (the body rendered for the source language and its default country with the merged preview data, with data-edit-id on the elements, the ids that the findings use). An html section that has a layout that mail clients do not support (flex, grid, float, position, a div around a table) is dropped and listed as html-section-dropped. The mail is 600 pixels wide, and the renderer writes no lang on the html element.

Request body ​

Response ​

The body, the texts, what was adjusted, the findings and a preview.