Skip to content

Mail

mail_template_create

Create a draft email template.

Tool

mail_template_create

Create a draft email template.

Create a draft email template with typed {{ variable }} placeholders in the subject and body. Declare variables (name, type, optional, fallback) so sends can be validated. Publish the template before sending by reference.

Arguments

NameTypeRequiredDescription
namestringHuman label for the template.
subjectstringSubject line; may contain {{ variable }} placeholders.
htmlstringHTML body; may contain {{ variable }} placeholders.
variablesarrayDeclared variables ([{ name, type, optional, fallback }], up to 20).

Try it

Create a template named Welcome with a {{ first_name }} placeholder in the subject.

When to use

Create a draft email template with typed {{ variable }} placeholders in the subject and body. Declare variables (name, type, optional, fallback) so sends can be validated. Publish the template before sending by reference.

Example

Ask your agent something like this:

Create a template named Welcome with a {{ first_name }} placeholder in the subject.

The agent will invoke mail_template_create with these arguments:

{
  "name": "Welcome",
  "subject": "Welcome, {{ first_name }}",
  "html": "<p>Hi {{ first_name }}</p>",
  "variables": [
    {
      "name": "first_name",
      "type": "string"
    }
  ]
}

Esc

Start typing to search the docs.

navigateselect