method EmailChannel.prototype.isHealthy
Since 0.6.0
EmailChannel.prototype.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.

Return Type

Promise<boolean | undefined>

true reachable, false contacted and unreachable, undefined when the mailer cannot answer

Usage

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