email.send
The high-level way to send one email from the app's own verified sender. body is markdown, HTML, or a CDN URL to hosted HTML, auto-detected unless you pin bodyType, and at least one of to, cc, or bcc must resolve to a recipient. Set category: 'transactional' for receipts, password resets, and sign-in codes so the message carries no unsubscribe header and is never held back by the suppression list; leave it at the default 'marketing' for anything a recipient can opt out of.
The call returns the addresses it accepted (recipients), any it skipped for a prior unsubscribe (suppressed — a normal success state on a marketing send, not an error), and a batchId you can pass to email.batch to watch delivery drain. The underlying send also reports cc, bcc, and the resolved from.
This is the door most sends should use. Reach for the lower-level sendEmail action only when you need connectionId to resolve recipients from an OAuth connection, or generateHtml to have a model style the body — the two things email.send does not carry.
import { email } from '@mindstudio-ai/agent'; const { recipients, suppressed, batchId } = await email.send({ to: 'user@example.com', subject: 'Your receipt', body: 'Thanks for your order — details inside.', category: 'transactional', });