import { email } from "platform:email";Requires a configured sender address under Email Settings. Each workspace brings its own provider key, so mail is sent from your domain.
email.send
Section titled “email.send”const { id, from } = await email.send({ to: "ops@example.com", subject: "Nightly triage complete", html: "<p>12 issues escalated.</p>",});SendEmailInput
Section titled “SendEmailInput”| Field | Required | Purpose |
|---|---|---|
to | yes | Recipient, or an array of them |
subject | yes | Subject line |
html | no | HTML body |
text | no | Plain-text body |
from | no | A registered sender; defaults to the workspace default |
cc, bcc | no | Additional recipients |
replyTo | no | Reply-To address |
headers | no | Extra headers |
Supply html, text, or both. Sending both lets each client pick.
Result
Section titled “Result”interface SendEmailResult { id: string; // provider message id from: string; // the sender actually used}Read from back when you omitted it and need to know which sender was applied.
email.listSenders
Section titled “email.listSenders”Enumerate available senders — useful for a picker in a custom view.
const senders = await email.listSenders();| Field | Meaning |
|---|---|
email | Address, valid as from |
display_name | Friendly name, if configured |
is_default | Used when from is omitted |
verified | Whether the address is verified |
is_personal | A personal sender owned by the running user |
const usable = senders.filter((s) => s.verified);Receiving mail
Section titled “Receiving mail”Inbound email is a separate module — implement InboundEmailHandler from
platform:inbound-email and route addresses to it under Email Settings.
Handlers run as SYSTEM, since a message from outside has no authenticated user.