Guides
Messages
How email and SMS delivery works in Connect.
Messages are the core of Connect. You send them through the SDK or API, and Connect handles delivery, status tracking, and event notifications.
Channels
Connect supports two channels:
- Email — requires a verified email domain (set up in the dashboard)
- SMS — requires a phone number (provisioned in the dashboard)
Each message targets exactly one channel. You specify this with the channelType field.
Sending a message
Every message.send call creates a message record, attempts delivery, and returns the result:
const msg = await connect.message.send({
channelType: "email",
emailDomainId: "dom_...",
to: "user@example.com",
subject: "Hello",
body: "<p>Welcome!</p>",
});
console.log(msg.status); // "sent"For SMS:
const sms = await connect.message.send({
channelType: "sms",
phoneNumberId: "pn_...",
to: "+15551234567",
body: "Your code is 123456",
});Message lifecycle
Every message passes through these statuses:
queued → sent → delivered
↘ failed
↘ bounced
↘ rejected| Status | What happened |
|---|---|
queued | Message created, waiting for delivery |
sent | Handed off to the provider |
delivered | Confirmed delivered to recipient |
failed | Delivery attempt failed |
bounced | Recipient address bounced |
rejected | Provider rejected the message |
Templates and contacts
You can optionally attach a template and/or a contact to any message:
templateId— renders the message body from a reusable template with variable substitutioncontactId— links the message to a contact for tracking
Filtering messages
List messages with filters for debugging or analytics:
const { items } = await connect.message.list({
status: "failed",
channelType: "email",
limit: 50,
offset: 0,
});Delivery events
Set up webhooks to get real-time notifications when message statuses change. Events include message.sent, message.delivered, message.failed, message.bounced, and message.rejected.