import nodemailer from "nodemailer"; const transporter = nodemailer.createTransport({ host: process.env.SMTP_HOST || "localhost", port: parseInt(process.env.SMTP_PORT || "587"), secure: process.env.SMTP_SECURE === "true", auth: process.env.SMTP_USER ? { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS, } : undefined, }); const FROM = process.env.EMAIL_FROM || "noreply@sexy.pivoine.art"; const BASE_URL = process.env.PUBLIC_URL || "http://localhost:3000"; export async function sendVerification(email: string, token: string): Promise { await transporter.sendMail({ from: FROM, to: email, subject: "Verify your email", html: `

Click here to verify your email.

`, }); } export async function sendPasswordReset(email: string, token: string): Promise { await transporter.sendMail({ from: FROM, to: email, subject: "Reset your password", html: `

Click here to reset your password.

`, }); }