import nodemailer from 'nodemailer' const transporter = nodemailer.createTransport({ host: process.env.SMTP_HOST, port: parseInt(process.env.SMTP_PORT || '587'), secure: process.env.SMTP_PORT === '465', auth: { user: process.env.SMTP_USERNAME, pass: process.env.SMTP_PASSWORD, }, }) const fromName = process.env.SMTP_FROM_NAME || 'BreakPilot' const fromAddr = process.env.SMTP_FROM_ADDR || 'noreply@breakpilot.ai' export async function sendMagicLinkEmail( to: string, investorName: string | null, magicLinkUrl: string ): Promise { const greeting = investorName ? `Hello ${investorName}` : 'Hello' await transporter.sendMail({ from: `"${fromName}" <${fromAddr}>`, to, subject: 'Your BreakPilot Pitch Deck Access', html: `

BreakPilot ComplAI

Investor Pitch Deck

${greeting},

You have been invited to view the BreakPilot ComplAI investor pitch deck. Click the button below to access the interactive presentation.

View Pitch Deck

This link expires in ${process.env.MAGIC_LINK_TTL_HOURS || '72'} hours and can only be used once.

${magicLinkUrl}

If you did not expect this email, you can safely ignore it. This is an AI-first company — we don't do PDFs.

`, }) }