send_email
Send an email to a lead, a person (contact_id) or an organisation (account_id) — or to any address. Required: subject, body, and lead_id, contact_id, account_id or to_address (to_address defaults to the record's e-mail). Sender: from_email picks one of the tenant's connected mailboxes (own SMTP server, Microsoft or Google); as_me=true sends with your name and sets Reply-To to your address so answers reach you; or set reply_to. If the tenant has switched off external providers (mail_only_own_server), the mail is only sent through an own mailbox. The mail appears in the person's/lead's history. Optional: campaign_id, bcc. Creates a draft and sends it via the existing email pipeline. SENDS FOR REAL to the lead — use send_draft_email first if a human needs to approve. Optional: attachments — document_ids of files already stored (upload_document / create_document_upload_url, or a campaign document). They travel as an expiring download link appended to the mail, and an unknown or foreign document_id ABORTS the send rather than quietly dropping the attachment: a mail whose text points at an enclosure that never came is worse than no mail. Optional: attachment_mode — 'link' (default: an expiring download link is appended to the mail; no size limit, and you can see who downloaded) or 'file' (the file really travels as an attachment; capped at 20 MB in total, because above that receiving servers start refusing the mail). For a brochure the link is usually better, for an invoice or a signed document it is the wrong form. UNSUBSCRIBE (marketing/campaign mails): set unsubscribe_link=true or put {{abmelde_link}} (alias {{unsubscribe_url}}) into body and body_html — every recipient gets a personal signed unsubscribe link (no address in the URL) plus List-Unsubscribe and List-Unsubscribe-Post: One-Click headers. Clicking it records the withdrawal in this tenant (consent revoked, address on the blocklist, entry in the record history). Addresses on the blocklist (list_blacklist, channel email_unsubscribe — also Brevo imports via sync_brevo_unsubscribes) are REFUSED for every purpose except rechnung/vertrag, with a clear error.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"subject": "<subject>",
"body": "<body>"
},
"name": "send_email"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bcc | No | Extra blind-copy recipients for THIS send — array or comma-separated string. ADDS TO the campaign's bcc_emails, it does not replace them; set the campaign field for a copy that cannot be forgotten. Invalid addresses are dropped and logged, they never block the send. | |
| body | Yes | Plain-text body (also the text/plain part when body_html is given). | |
| as_me | No | Your name as sender name, Reply-To your login address. | |
| lead_id | No | ID of the lead | |
| purpose | No | The processing purpose of THIS mail (e.g. akquise, newsletter, bestandskunde, rechnung). A consent is always for ONE purpose: whoever agreed to the newsletter did not agree to cold outreach, so without a purpose the check can only look at the record's state and at withdrawals. Falls back to the campaign's processing_purpose. If the tenant has switched on legal_basis_enforced, a mail without any purpose is refused. | |
| subject | Yes | Subject line | |
| language | No | Language of the unsubscribe confirmation page: de, en, fr, it, nl, es (default de). | |
| reply_to | No | Reply-to email address | |
| body_html | No | Optional designed HTML version of the mail, sent UNCHANGED as the text/html part (multipart/alternative); body stays required and is the plain-text part. Attachment links, unsubscribe and AI notice are inserted before </body> (or appended). Max 512 KB; link images, no data: URLs. | |
| from_name | No | Sender display name | |
| account_id | No | ID of the account (company) | |
| contact_id | No | ID of the contact | |
| from_email | No | Address of a connected mailbox of this tenant to send from (list_mailboxes). The mail goes out through exactly that mailbox; an address without a matching mailbox is refused. | |
| to_address | No | Recipient email address | |
| attachments | No | document_ids | |
| campaign_id | No | ID of the campaign | |
| campaign_tag | No | Short campaign label recorded with an unsubscribe (e.g. haendler-mail-1). | |
| attachment_mode | No | link (default) or file | |
| unsubscribe_link | No | Add a personal unsubscribe link + List-Unsubscribe headers (on automatically when the text contains {{abmelde_link}} / {{unsubscribe_url}}). Without a placeholder a short German note with the link is appended. |