Emails with dynamic content

|

View as Markdown

There are two supported approaches for sending emails with dynamic content:

  1. Template language (recommended)
    • Use the templateLanguageVersion=2 parameter in your API request.
    • Allows more powerful syntax for substitutions, logic, and expressions.
  2. Legacy handlebars helpers
    • Do not set templateLanguageVersion in the API request.
    • Still supported for backward compatibility.

See the Send fully featured email API endpoint for the full API reference.

Refer to the Template language and Legacy handlebars sections below to learn more about these two approaches.


Template language (recommended)

To send emails with dynamic content, use the template language within your HTML content and define placeholder values in the to or default parameter of your request.

You can add any available template language constructs to handle substitutions, conditional statements, or iterations directly in your email template.

For details, see Template language.


Legacy handlebars helpers

Legacy helpers use the familiar {{#helper}} ... {{/helper}} syntax. These are still supported, but we recommend migrating to the new template language for future-proof projects.





Was this page helpful?