Skip to content

@btravstack/mailer


@btravstack/mailer / smtp

smtp

Classes

MailerConfig

Defined in: packages/mailer/src/smtp.ts:22

What the graph bound from the environment for the SMTP adapter.

Extends

  • PortInstance<"MailerConfig", { url: string; }>

Constructors

Constructor
ts
new MailerConfig(): MailerConfig;

Defined in: packages/di/dist/index.d.mts:16

Returns

MailerConfig

Inherited from
ts
Port("MailerConfig")<{ readonly url: string }>.constructor

Properties

PropertyModifierTypeInherited fromDefined in
[ID]readonly"MailerConfig"Port("MailerConfig").[ID]packages/di/dist/index.d.mts:12
[SERVICE]readonlyobjectPort("MailerConfig").[SERVICE]packages/di/dist/index.d.mts:13
[SERVICE].urlreadonlystring-packages/mailer/src/smtp.ts:22
portIdreadonly"MailerConfig"Port("MailerConfig").portIdpackages/di/dist/index.d.mts:17

Variables

smtpSchema

ts
const smtpSchema: ConfigSchema<Readonly<Record<string, string | undefined>>, {
  url: string;
}>;

Defined in: packages/mailer/src/smtp.ts:29

SMTP_URL, required. One URL rather than a host/port/user/password quartet: it is what the transport takes and what a deployment already stores as one secret. An unset variable is a ConfigInvalid naming it, at graph build.

Functions

smtpMailer()

ts
function smtpMailer(): Module<MailerBackend | HealthChecks, ConfigInvalid, Env | Scope>;

Defined in: packages/mailer/src/smtp.ts:128

The SMTP adapter: one pooled transport, opened with the scope and closed with it, and MailerBackend over it. nodemailer is an optional peer reached only through this subpath.

Returns

Module<MailerBackend | HealthChecks, ConfigInvalid, Env | Scope>


smtpMailerBackend()

ts
function smtpMailerBackend(transport): MailerService;

Defined in: packages/mailer/src/smtp.ts:43

The adapter's service over a transport. A rejected send becomes a modeled MailNotSent carrying the envelope and the transport's own words — never the body.

Parameters

ParameterType
transportTransporter

Returns

MailerService

Released under the MIT License.