import { transporter } from "@/lib/nodemailer"; export const sendPasswordResetEmail = async ( { email, name, resetUrl }: { email: string; name?: string | null; resetUrl: string } ) => { try { if (!process.env.NODEMAILER_EMAIL || !process.env.NODEMAILER_PASSWORD) { throw new Error('Email credentials not configured'); } const firstName = name?.trim().split(' ')[0] || 'there'; const html = `
Hi ${firstName},
We received a request to reset your Openstock password. Use the button below to choose a new one.
Reset passwordIf you did not request this, you can safely ignore this email.