import nodemailer from 'nodemailer'; // Create reusable transporter object using SMTP transport const transporter = nodemailer.createTransport({ service: 'iCloud', secure: false, auth: { user: 'soconnor0919@icloud.com', pass: 'uhlb-virv-qqpk-puwc', }, }); // Verify connection configuration transporter.verify(function(error, success) { if (error) { console.log('SMTP Verification Error:', error); } }); interface SendInvitationEmailParams { to: string; inviterName: string; studyTitle: string; role: string; token: string; } export async function sendInvitationEmail({ to, inviterName, studyTitle, role, token, }: SendInvitationEmailParams) { const inviteUrl = `${process.env.NEXT_PUBLIC_APP_URL}/invite/accept/${token}`; const roleDisplay = role .split('_') .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) .join(' '); const html = `
|