Files
anouma/lib/email/sendBookingEmails.ts
T
maro 7edeafe7c3
CI / test (push) Canceled after 0s
Release / promote-and-deploy (push) Canceled after 0s
CI / build-image (push) Canceled after 0s
Improve email branding and SMTP envelope
2026-09-18 12:51:40 +02:00

18 lines
494 B
TypeScript

import { getMailEnvelopeFrom, getMailFrom, getMailTransport } from "./transport";
export async function sendEmail(
to: string,
template: { subject: string; html: string },
options: { replyTo?: string } = {},
) {
const transport = getMailTransport();
await transport.sendMail({
from: getMailFrom(),
envelope: { from: getMailEnvelopeFrom() },
to,
subject: template.subject,
html: template.html,
...(options.replyTo ? { replyTo: options.replyTo } : {}),
});
}