Transports
Transports
Choose a provider transport for a channel sender.
Transports connect a sently channel sender to a delivery provider. Pick the transport that matches the channel you are sending on.
The one rule
Keep application delivery calls on a sently channel sender and replace only its transport when you change providers.
import { createMailer } from "sently/mailer";
import { ResendTransport } from "sently/transports/resend";
const mailer = await createMailer({
transport: new ResendTransport({
apiKey: process.env.RESEND_API_KEY!,
}),
});await mailer.send({
from: "hello@example.com",
to: "person@example.com",
subject: "Welcome",
text: "Thanks for joining.",
});Exported transports
Every import below is an exported package subpath.
| Transport | Channel | Import |
|---|---|---|
| SMTP | sently/transports/smtp | |
| Resend | sently/transports/resend | |
| SendGrid | sently/transports/sendgrid | |
| Postmark | sently/transports/postmark | |
| Mailgun | sently/transports/mailgun | |
| SES | sently/transports/ses | |
| Brevo | sently/transports/brevo | |
| MailerSend | sently/transports/mailersend | |
| Plunk | sently/transports/plunk | |
| SparkPost | sently/transports/sparkpost | |
| Mailtrap | sently/transports/mailtrap | |
| Loops | sently/transports/loops | |
| Cloudflare Email | sently/transports/cloudflare-email | |
| SNDR | sently/transports/sndr | |
| Taqnyat Mail | sently/transports/taqnyat-mail | |
| Twilio SMS | SMS | sently/transports/twilio-sms |
| Taqnyat SMS | SMS | sently/transports/taqnyat-sms |
| Msegat | SMS | sently/transports/msegat |
| Unifonic | SMS | sently/transports/unifonic |
| WhatsApp Cloud | sently/transports/whatsapp-cloud | |
| Taqnyat WhatsApp | sently/transports/taqnyat-whatsapp | |
| Web Push | Push | sently/transports/webpush |
| FCM | Push | sently/transports/fcm |
For retry, fallback, preview, and idempotency wrappers, see Decorators.
Channel contracts
| Channel | Sender | Transport contract |
|---|---|---|
createMailer / createSMTPMailer | Transport | |
| SMS | createSmsSender | SmsTransport |
createWhatsAppSender | WhatsAppTransport | |
| Push | createPushSender | PushTransport |
Troubleshooting
No. A transport implements one channel contract. Choose a transport listed for the channel sender you use.
Wrap any channel transport with a decorator, then pass the wrapper to the matching sender.