/** Sends transactional email via SMTP when configured; the caller decides what to do when this * returns false (e.g. log the link so an admin can hand it to the user manually). */ export async function sendMail({ smtpUrl, from, to, subject, text }) { if (!smtpUrl) return false; const { default: nodemailer } = await import("nodemailer"); const transporter = nodemailer.createTransport(smtpUrl); await transporter.sendMail({ from, to, subject, text }); return true; }