Setu-TS
    Preparing search index...

    Function createChannel

    NotificationPlugin factory — registers an INotifier under CAPABILITIES.NOTIFICATION.

    import { NotificationPlugin } from '@setu-ts/notification-plugin';

    app.register(NotificationPlugin({
    channels: {
    email: { provider: 'mail' },
    sms: { provider: 'twilio', options: { accountSid: '…', authToken: '…', from: '+1234' } },
    },
    }));

    0.1.0

    • Creates a NotificationChannel for the given channel entry.

      Resolves the transport via createProvider, then wraps it in the matching channel class (EmailChannel, SmsChannel, PushChannel, or SlackChannel).

      Parameters

      • name: string

        The channel dispatch name

      • config: ChannelConfig

        The channel configuration

      • Optionalctx: IPluginContext

        The plugin context (required for 'mail', which resolves IMailer)

      Returns NotificationChannel

      The configured channel

      If the provider type is unsupported or mail is used without MailPlugin

      0.1.0