class EmailChannel
implements NotificationChannel
Since 0.1.0

EmailChannel dispatches notifications through the resolved IMailer.

Constructors

EmailChannel(
name: string,
mailer: IMailer
)

Properties

readonly
name: string

Channel dispatch name (e.g. 'email', 'sms').

Methods

Since 0.6.0
isHealthy(): Promise<boolean | undefined>

Reports the mail transport's reachability by asking the injected IMailer, which is the only channel in this package whose transport offers a side-effect-free probe.

isHealthy is optional on IMailer, so an injected mailer that does not implement it — an application's own stub, or a MailService over a provider with no probe — yields undefined rather than a guess.

send(notification: NotificationMessage): Promise<void>

Builds a MailMessage and sends it via IMailer.

Usage

import { EmailChannel } from "notification-plugin/src/index.ts";