Compile template

Compiles an MJML template with provided data, returning the rendered HTML. Useful for previewing templates before saving.

post/api/templates.compile

Request body

template_contentobject required

MJML template structure to compile

template_dataobject required

Data to use for Liquid templating

Example request

{
  "template_data": {
    "user_name": "John Doe",
    "action_url": "https://example.com/action"
  }
}

Response

Template compiled successfully

htmlstring

Compiled HTML output

errorsstring[]

Compilation errors, if any

Changes