Files
maro 45261a0461 Initial commit: ANOUMA website with Payload CMS, WebRTC meetings, and booking system
- Next.js 16 App Router site with the ANOUMA design system
- Payload CMS (PostgreSQL) for offers, events, posts and page content
- WebRTC video-call system with custom signaling server
- SMTP email reminders and booking-request notifications
- Customer accounts, calendar-based availability, and booking workflow
2026-08-25 16:40:51 +02:00

26 lines
836 B
TypeScript

import nodemailer from "nodemailer";
let cached: nodemailer.Transporter | null = null;
/** SMTP transporter for the existing ANOUMA mail system — no external newsletter service. */
export function getMailTransport(): nodemailer.Transporter {
if (cached) return cached;
const { SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD } = process.env;
if (!SMTP_HOST || !SMTP_PORT || !SMTP_USER || !SMTP_PASSWORD) {
throw new Error("SMTP_HOST, SMTP_PORT, SMTP_USER and SMTP_PASSWORD must be set to send email.");
}
cached = nodemailer.createTransport({
host: SMTP_HOST,
port: Number(SMTP_PORT),
secure: Number(SMTP_PORT) === 465,
auth: { user: SMTP_USER, pass: SMTP_PASSWORD },
});
return cached;
}
export function getMailFrom(): string {
return process.env.SMTP_FROM || "ANOUMA <support@anouma.org>";
}