Classes

c
LogProvider(options?: LogProviderOptions)

Records outgoing mail instead of sending it.

c
MailService(
provider: MailProvider,
templates: TemplateEngine,
options?: MailServiceOptions
)

Mailer backed by a pluggable provider and a template engine.

c
SendGridProvider(options?: SendGridProviderOptions)

SendGrid provider over fetch.

c
SesProvider(options?: SesProviderOptions)

AWS SESv2 provider.

c
SmtpProvider(options?: SmtpProviderOptions)

SMTP provider over nodemailer.

c
TemplateEngine(templates?: Readonly<Record<string, MailTemplate>>)

A registry of named body templates with {{ variable }} interpolation.

Functions

f
adaptNodemailerModule(
mod: NodemailerModule,
options: SmtpProviderOptions
): ISmtpTransport

Adapts the nodemailer module to a transport facade. Pure — unit-tested with a fake module; the real module is supplied on the lazy path by loadNodemailerModule.

f
adaptSesModule(
mod: SesSdkModule,
options: SesProviderOptions
): ISesClient

Adapts the AWS SESv2 SDK module to the facade. Pure — unit-tested with a fake module; the real module is supplied on the lazy path by loadSesModule.

f
escapeHtml(value: string): string

Escapes the five HTML-significant characters so interpolated user data cannot inject markup into an HTML body.

f
loadNodemailerModule(): Promise<NodemailerModule>

Lazily imports nodemailer. Only exercised on the lazy path.

f
loadSesModule(): Promise<SesSdkModule>

Lazily imports the AWS SESv2 SDK. Only exercised on the lazy path.

f

Interfaces

I
IMailer

Email sender.

I
ISesClient

Structural shape of an AWS SESv2 client facade (injected or SDK-adapted). The plugin never hard-depends on @aws-sdk/client-sesv2.

I
ISmtpTransport

Structural shape of a nodemailer transport. The plugin never hard-depends on nodemailer; inject this shape, or SmtpProvider lazily loads the package and adapts it to this facade.

I
LogProviderOptions

Options for LogProvider.

I
MailMessage

An outgoing email message.

I
MailPluginOptions

Options for the MailPlugin factory.

I
MailProviderOptions

Provider-specific options. Fields are consumed only by the matching provider; unrelated fields are ignored (mirrors SecretsProviderOptions).

I
MailServiceOptions

Options for MailService.

I
MailTemplate

A named body template. At least one of html/text must be present.

  • html: string

    HTML body template with {{ variable }} placeholders (values escaped).

  • text: string

    Plain-text body template with {{ variable }} placeholders (raw).

I
RenderedTemplate

A rendered template body. Only present bodies are returned.

I
SendGridProviderOptions

Options for SendGridProvider.

I
SesProviderOptions

Options for SesProvider.

I
SmtpProviderOptions

Options for SmtpProvider.

Type Aliases

T
IMailHttp = (
url: string,
init?: RequestInit
) => Promise<Response>

A fetch-shaped function used by SendGridProvider so it stays runtime-agnostic and testable.

T
OutgoingMail = MailMessage & { readonly from: string; }

An outgoing email whose sender has already been resolved by MailService (from the message or the configured default). This is the shape every MailProvider receives — from is never absent.