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
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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>";
|
||||
}
|
||||
Reference in New Issue
Block a user