method IMailer.sendTemplate
IMailer.sendTemplate(
template: string,
message: Omit<MailMessage, "html" | "text">,
data: Readonly<Record<string, unknown>>
): Promise<void>

Renders a named template and sends the result.

Parameters

template: string

Template name

message: Omit<MailMessage, "html" | "text">

Envelope (recipients, subject overrides)

data: Readonly<Record<string, unknown>>

Template variables

Return Type

Promise<void>

Throws

Error

If the template is unknown or the provider rejects the message

Usage

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