send_email
Send transactional emails using predefined templates (project invite, magic link, notification) or custom HTML. Supports attachments, threading, and variable substitution.
Instructions
Send an email. Two modes: template (project_invite, magic_link, notification) or raw HTML (subject + html). Optional from_name for display name. Single recipient only. Pass mailbox to target a slug/id; otherwise the configured default_outbound_mailbox_id is used. Result echoes mailbox_id and from_address when the gateway provides them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient email address (single recipient only) | |
| html | No | HTML email body (raw HTML mode, max 1MB) | |
| text | No | Plain text fallback (raw HTML mode, auto-generated from HTML if omitted) | |
| mailbox | No | Target mailbox by slug or id. If omitted, the configured default_outbound_mailbox_id is used; missing/invalid defaults return typed repair errors. | |
| subject | No | Email subject line (raw HTML mode, max 998 chars) | |
| template | No | Email template (template mode). project_invite, magic_link, or notification | |
| from_name | No | Display name for From header, e.g. "My App" (max 78 chars) | |
| variables | No | Template variables (template mode). project_invite: project_name, invite_url. magic_link: project_name, link_url, expires_in. notification: project_name, message (max 500 chars). | |
| project_id | Yes | The project ID | |
| attachments | No | Binary attachments — RAW HTML MODE ONLY (with subject + html, not template). Max 5; ≤ 7 MB total (decoded). | |
| in_reply_to | No | ID of a prior message (typically inbound) to thread this one under. The server uses it to set RFC-822 In-Reply-To and References headers. Usually set via reply flows; leave empty for new threads. |