diff --git a/src/lib/email/templates/inquiry-client-confirmation.ts b/src/lib/email/templates/inquiry-client-confirmation.ts new file mode 100644 index 0000000..f84b00d --- /dev/null +++ b/src/lib/email/templates/inquiry-client-confirmation.ts @@ -0,0 +1,82 @@ +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, '''); +} diff --git a/src/lib/email/templates/inquiry-sales-notification.ts b/src/lib/email/templates/inquiry-sales-notification.ts new file mode 100644 index 0000000..4536bb5 --- /dev/null +++ b/src/lib/email/templates/inquiry-sales-notification.ts @@ -0,0 +1,80 @@ +export interface InquirySalesNotificationData { + fullName: string; + email: string; + phone: string; + mooringNumber: string | null; + crmUrl: string; +} + +export function inquirySalesNotification(data: InquirySalesNotificationData) { + const { fullName, email, phone, mooringNumber, crmUrl } = data; + const mooringDisplay = mooringNumber || 'None'; + + const subject = 'New Interest - Port Nimara'; + + const html = ` + + + + + New Interest - Port Nimara + + + + + + + +
+ + + + +
+
+ Port Nimara Logo +
+

Dear Administrator,

+

${escapeHtml(fullName)} has expressed their interest in Port Nimara. Here are their details:

+

Name: ${escapeHtml(fullName)}

+

Email: ${escapeHtml(email)}

+

Telephone: ${escapeHtml(phone)}

+

Berths Selected: ${escapeHtml(mooringDisplay)}

+

Please visit the Port Nimara CRM to view more information.

+

Thank you,
Port Nimara CRM

+
+
+ +`; + + const text = [ + 'Dear Administrator,', + '', + `${fullName} has expressed their interest in Port Nimara. Here are their details:`, + '', + `Name: ${fullName}`, + `Email: ${email}`, + `Telephone: ${phone}`, + `Berths Selected: ${mooringDisplay}`, + '', + `Please visit the Port Nimara CRM (${crmUrl}) to view more information.`, + '', + 'Thank you', + 'Port Nimara CRM', + ].join('\n'); + + return { subject, html, text }; +} + +function escapeHtml(str: string): string { + return str + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +}