Decorators

Weighted fallback

Choose a weighted primary transport and fail over on errors.

Choose a weighted primary transport and fail over on errors. Works with email, SMS, WhatsApp, and push.

The one rule

At least one entry with positive total weight is required.

Configuration

Each entry has transport and positive weight; it accepts fallback options and optional random.

Quick start

import { WeightedFallbackTransport } from "sently/transports/weighted-fallback";

const transport = new WeightedFallbackTransport([
  { transport: primary, weight: 80 },
  { transport: secondary, weight: 20 },
]);
const mailer = await createMailer({ transport });
// or createSmsSender / createWhatsAppSender / createPushSender

Troubleshooting

Next

On this page