Setu-TS
    Preparing search index...

    Interface INotifier

    Multi-channel notification dispatcher.

    const notifier = ctx.services.get<INotifier>(CAPABILITIES.NOTIFICATION);
    await notifier.send({
    channels: ['email', 'sms'],
    to: { email: user.email, phone: user.phone },
    subject: 'Order shipped',
    body: 'Your order is on its way.',
    });

    0.1.0

    interface INotifier {
        send(notification: NotificationMessage): Promise<void>;
        sendSettled?(
            notification: NotificationMessage,
        ): Promise<readonly ChannelSendResult[]>;
    }

    Implemented by

    Index
    • Dispatches a notification on every requested channel and reports the settled outcome of each, without throwing.

      Unlike INotifier.send, this never rejects: a failed channel is reported as { channel, ok: false, error } rather than raised, so a caller (typically one behind a retrying queue) can retry the failing channel alone instead of re-sending the whole notification. An unknown channel name is reported as ok: false, matching send's existing treatment of it as a failure.

      Optional on the contract so existing implementors are not broken; resolve it with ?. and fall back to INotifier.send when absent.

      Parameters

      Returns Promise<readonly ChannelSendResult[]>

      One non-throwing result per requested channel, in request order

      0.1.0