import nodemailer from "nodemailer"; // E-mail via SMTP (zie SMTP_* in CLAUDE.md). Zonder SMTP_HOST wordt er niets verstuurd; // de aanroeper toont dan bijvoorbeeld de uitnodigingslink in beeld. export function isMailConfigured(): boolean { return Boolean(process.env.SMTP_HOST); } export async function sendMail(message: { to: string; subject: string; text: string; html?: string }): Promise { const port = Number(process.env.SMTP_PORT || 587); const transport = nodemailer.createTransport({ host: process.env.SMTP_HOST, port, secure: port === 465, auth: process.env.SMTP_USER ? { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS } : undefined, }); await transport.sendMail({ from: process.env.SMTP_FROM || "noreply@rikx.nl", ...message }); }