Create
Create a new template using the default context.Parameters
The template creation parameters.
Returns
Returns a*CreateTemplateResponse containing the created template ID.
Example
CreateWithContext
Create a new template with a custom context.Parameters
Context for the request, useful for timeouts and cancellation.
The template creation parameters.
Returns
Returns a*CreateTemplateResponse containing the created template ID.
Example
Types
CreateTemplateRequest
Request payload for creating a template.The name of the template.
A unique alias for the template. Can be used instead of the ID to reference the template.
The sender email address. Can be a plain email or formatted as “Name <[email protected]>”.
The email subject line. Can include template variables like
{{{variable_name}}}.Reply-to email address. Can be a string or array of strings.
The HTML content of the email template. Use
{{{variable_name}}} syntax for variables.Important: All variables referenced in Html must be declared in the Variables array, or the API will return a validation error.Plain text version of the email template.
Array of variable declarations used in the template. All variables referenced in Html or Subject must be declared here.
CreateTemplateResponse
Response from creating a template.The unique identifier of the created template.
The object type, always “template”.
TemplateVariable
Represents a variable in a template.The variable name (without the curly braces). For example, for
{{{name}}}, use “name”.The type of the variable. Can be
VariableTypeString or VariableTypeNumber.Default value to use if the variable is not provided when sending an email.