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

Reports whether the mail transport is REACHABLE right now, distinct from whether the mailer was constructed. Optional: a mailer whose transport exposes no side-effect-free probe omits it, and so does an implementation that does not answer the question at all.

A false means the transport was contacted and did not answer. An undefined means the question could not be asked โ€” never read it as healthy. This is the tri-state every reachability seam in the framework uses (IRedisClient.ping, StorageProvider.isHealthy, IMessageBroker.isHealthy), and it exists so a holder of an IMailer โ€” notification-plugin's email channel, an application's own health indicator โ€” can report the transport without importing mail-plugin, which AI_GUIDELINES ยง2.2 forbids.

Return Type

Promise<boolean | undefined>

true reachable, false contacted and unreachable, undefined when reachability cannot be determined

Usage

import { type IMailer } from "common/src/index.ts";