export interface InquiryClientConfirmationData { firstName: string; mooringNumber: string | null; contactEmail: string; } export function inquiryClientConfirmation(data: InquiryClientConfirmationData) { const { firstName, mooringNumber, contactEmail } = data; const berthText = mooringNumber ? `Berth ${mooringNumber}` : 'a Port Nimara Berth'; const subject = mooringNumber ? `Thank You for Your Interest in Berth ${mooringNumber}` : 'Thank You for Your Interest in a Port Nimara Berth'; const html = ` ${subject}
Port Nimara Logo

Dear ${escapeHtml(firstName)},

Thank you for expressing interest in ${escapeHtml(berthText)}. Our team has registered your interest, and we will reach out to you very shortly by your preferred method of contact with more information.

If you have any questions, please feel free to reach out to us at ${escapeHtml(contactEmail)}.

Best regards,
The Port Nimara Sales Team

`; const text = [ `Dear ${firstName},`, '', `Thank you for expressing interest in ${berthText}. Our team has registered your interest, and we will reach out to you very shortly by your preferred method of contact with more information.`, '', `If you have any questions, please feel free to reach out to us at ${contactEmail}.`, '', 'Best regards,', 'The Port Nimara Sales Team', ].join('\n'); return { subject, html, text }; } function escapeHtml(str: string): string { return str .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); }