Emails with dynamic content
There are two supported approaches for sending emails with dynamic content:
- Template language (recommended)
- Use the
templateLanguageVersion=2parameter in your API request. - Allows more powerful syntax for substitutions, logic, and expressions.
- Use the
- Legacy handlebars helpers
- Do not set
templateLanguageVersionin the API request. - Still supported for backward compatibility.
- Do not set
See the Send fully featured email (opens in a new tab) 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.