Email API: Safer Liquid Templates

23, Sep 2026

The Telnyx Email API now gives developers more control over how Liquid templates handle variables and rendered content. New validation, defaults, and autoescaping options help make dynamic email templates safer and more predictable.

What's new

  • Required variable validation: Declare required variables in variable_schema, then enable strict_variables. Missing or empty required values fail rendering and sending with a 422 response. strict_variables alone does not infer requirements from the template.
  • Optional variable defaults: Define string defaults for optional variables in variable_schema; caller-supplied values take precedence. Required variables cannot define defaults.
  • HTML autoescaping: Enable autoescape to HTML-escape dynamic Liquid expression output in html_body. Subject and text-body output are not autoescaped.

Why it matters

Dynamic templates often depend on data supplied at send time. These updates give developers more control over what happens when variables are missing and how dynamic content is rendered.

Required-variable validation can catch missing data before a template is rendered or sent, while schema defaults provide values for omitted optional variables. HTML-body autoescaping reduces the risk of dynamic values being interpreted as markup without changing literal template HTML, subjects, or text bodies.

Getting started

Prerequisites

  • A Telnyx account
  • An API key from the Telnyx Portal
  • An Email API template using Liquid variables

Telnyx email templates support Liquid variables across subject, HTML, and text content and can be rendered and previewed before sending.

Learn more in the Email Templates documentation.