Reference

Channel send result

Map email, SMS, WhatsApp, and push results to a shared accepted shape.

Adapters that span channels can normalize every send into { messageId, provider, accepted } without inventing per-provider glue. Use this after mailer.send, sms.send, whatsapp.send, or push.send.

The one rule

Keep channel-specific fields on the original result; use toChannelSendResult only for the shared slice.

Quick start

import { createSmsSender } from "sently/sms";
import { toChannelSendResult } from "sently/channel-result";
import { UnifonicTransport } from "sently/transports/unifonic";

const sms = createSmsSender({
  transport: new UnifonicTransport({
    appSid: process.env.UNIFONIC_APPSID!,
    senderId: "MyBrand",
  }),
});
const result = await sms.send({ to: "+15551234567", body: "Hi" });
const shared = toChannelSendResult(result);
// { messageId, provider?, accepted }

ChannelSendResult

FieldTypeMeaning
messageIdstringProvider or client message id
providerstring?Transport id when set
acceptedbooleanProvider accepted the send (not end-user delivery)

Mapping

Channel resultaccepted
Email SendResultaccepted.length > 0 and rejected.length === 0
SMS / WhatsApp / Pushstatus in accepted / queued / sending / sent / delivered / read / success (case-insensitive)

Import from sently/channel-result or the main sently barrel.

Troubleshooting

Learn more

Next

On this page