API Depot/APIs/HTML Email Renderer

HTML Email Renderer

live

Render a Jinja2 HTML template with your data, inline all CSS for Outlook and Gmail compatibility, and get back a plain-text fallback — in one call.

POST /v1/email/renderPer render

Request

FieldTypeDescription
template*stringJinja2 HTML template string
dataobjectKey–value pairs injected into the template (default {})

Response

FieldTypeDescription
htmlstringRendered HTML with all CSS inlined; <style> blocks removed
textstringPlain-text fallback extracted from the rendered HTML

Example

Request

{
  "template": "<html><body><h1>Hello, {{ name }}!</h1><style>h1 { color: #333; }</style></body></html>",
  "data": {
    "name": "Alice"
  }
}

Response

{
  "html": "<html><body><h1 style=\"color: #333;\">Hello, Alice!</h1></body></html>",
  "text": "Hello, Alice!"
}

Notes

  • Sync endpoint — typically under 100ms.
  • Jinja2 autoescaping is on: user-supplied data is HTML-escaped automatically.
  • CSS inlining is done by premailer. All <style> blocks are removed from the output.
  • Does not send emails — rendering only.

Try it