Reference
?

sendEmail

Send an email to one or more recipient addresses.
mindstudio.sendEmail({ subject, body }) → Result

Sends an email from the app's own sender to one or more addresses, with optional cc, bcc, reply-to, and attachments; the body is markdown or HTML, auto-detected. Most sends use the higher-level email.send in the email namespace; reach for this action when you need connectionId to resolve recipients from an OAuth connection, or generateHtml to have a model style the body. The Gmail actions are for a connected personal account instead.

Parameters
subject
string
RequiredEmail subject line
body
string
RequiredEmail body content (plain text, markdown, HTML, or a CDN URL to an HTML file)
to
object
Direct recipient email address(es). On the shared Remy sender these must be verified app users or members of the app's org; unrestricted when the app sends from a domain it owns. Optional, but only because recipients can come from elsewher
cc
object
Additional visible (Cc) recipient(s); same recipient rules as `to`.
bcc
object
Additional hidden (Bcc) recipient(s); same recipient rules as `to`.
connectionId
string
OAuth connection ID(s) for the recipient(s), comma-separated for multiple
generateHtml
boolean
When true, auto-convert the body text into a styled HTML email using AI
generateHtmlInstructions
string
Natural language instructions for the HTML generation style
generateHtmlModelOverride
object
Model settings override for HTML generation
attachments
string[]
Files to attach: each entry is a URL string, or an object `{ url, filename?, contentType? }` to control the displayed filename and MIME type.
from
string
Custom sender handle — only for apps with a custom domain or subdomain. Bare handle (`support`), full `support@your-domain.com`, or `Name <support@your-domain.com>`. Must resolve to a domain the app owns.
bodyType
string
How to interpret `body`: `auto` (default — detect HTML, else render markdown), `html` (send as-is), `markdown` (render to HTML), or `text` (send as plain text only, no HTML part). Every send includes a text/plain alternative.
autohtmlmarkdowntext
text
string
Explicit text/plain alternative body. Auto-derived from `body` if omitted.
replyTo
string
Reply-To address for the email.
inReplyTo
string
Message-ID this email replies to, for inbox threading (In-Reply-To header).
references
string[]
Prior Message-IDs in the thread, for inbox threading (References header).
category
string
`marketing` (default) adds one-click unsubscribe headers and skips recipients who unsubscribed from this app. Use `transactional` for receipts, alerts and password resets: no unsubscribe header, never suppressed, and cc/bcc preserved on a s
transactionalmarketing
batchId
string
Groups this send's per-recipient rows into one blast, so per-campaign stats are readable afterwards. Pass your own campaign id (1-64 printable chars) to join our delivery stats onto your own tables with no mapping; omit it and one is genera
Call from a method
import { mindstudio } from '@mindstudio-ai/agent';

const result = await mindstudio.sendEmail({
  subject: /* ... */,
  body: /* ... */
});