Skip to content

Email

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.

const { id, from } = await email.send({
to: "ops@example.com",
subject: "Nightly triage complete",
html: "<p>12 issues escalated.</p>",
});
FieldRequiredPurpose
toyesRecipient, or an array of them
subjectyesSubject line
htmlnoHTML body
textnoPlain-text body
fromnoA registered sender; defaults to the workspace default
cc, bccnoAdditional recipients
replyTonoReply-To address
headersnoExtra headers

Supply html, text, or both. Sending both lets each client pick.

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.

Enumerate available senders — useful for a picker in a custom view.

const senders = await email.listSenders();
FieldMeaning
emailAddress, valid as from
display_nameFriendly name, if configured
is_defaultUsed when from is omitted
verifiedWhether the address is verified
is_personalA personal sender owned by the running user
const usable = senders.filter((s) => s.verified);

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.