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

Name Type Required Description
name string Human label for the template.
subject string Subject line; may contain {{ variable }} placeholders.
html string HTML body; may contain {{ variable }} placeholders.
variables array Declared 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.

navigate select