feat: add inquiry email templates for client confirmation and sales notification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
82
src/lib/email/templates/inquiry-client-confirmation.ts
Normal file
82
src/lib/email/templates/inquiry-client-confirmation.ts
Normal file
@@ -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 = `<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>${subject}</title>
|
||||
<style type="text/css">
|
||||
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
|
||||
img { border: 0; display: block; }
|
||||
p { margin: 0; padding: 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin:0; padding:0; background-color:#f2f2f2;">
|
||||
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image: url('https://s3.portnimara.com/images/Overhead_1_blur.png'); background-size: cover; background-position: center; background-color:#f2f2f2;">
|
||||
<tr>
|
||||
<td align="center" style="padding:30px;">
|
||||
<table role="presentation" width="600" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden; box-shadow:0 2px 4px rgba(0,0,0,0.1);">
|
||||
<tr>
|
||||
<td style="padding:20px; font-family: Arial, sans-serif; color:#333333;">
|
||||
<center>
|
||||
<img src="https://s3.portnimara.com/images/Port%20Nimara%20New%20Logo-Circular%20Frame_250px.png" alt="Port Nimara Logo" width="100" style="margin-bottom:20px;" />
|
||||
</center>
|
||||
<p style="margin-bottom:10px; font-size:16px;">Dear ${escapeHtml(firstName)},</p>
|
||||
<p style="margin-bottom:10px; font-size:16px;">
|
||||
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.
|
||||
</p>
|
||||
<p style="margin-bottom:10px; font-size:16px;">
|
||||
If you have any questions, please feel free to reach out to us at
|
||||
<a href="mailto:${escapeHtml(contactEmail)}" style="color:#007bff; text-decoration:underline;">${escapeHtml(contactEmail)}</a>.
|
||||
</p>
|
||||
<p style="font-size:16px;">
|
||||
Best regards,<br />
|
||||
The Port Nimara Sales Team
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
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, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
80
src/lib/email/templates/inquiry-sales-notification.ts
Normal file
80
src/lib/email/templates/inquiry-sales-notification.ts
Normal file
@@ -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 = `<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>New Interest - Port Nimara</title>
|
||||
<style type="text/css">
|
||||
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
|
||||
img { border: 0; display: block; }
|
||||
p { margin: 0; padding: 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin:0; padding:0; background-color:#f2f2f2;">
|
||||
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image: url('https://s3.portnimara.com/images/Overhead_1_blur.png'); background-size: cover; background-position: center; background-color:#f2f2f2;">
|
||||
<tr>
|
||||
<td align="center" style="padding:30px;">
|
||||
<table role="presentation" width="600" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden; box-shadow:0 2px 4px rgba(0,0,0,0.1);">
|
||||
<tr>
|
||||
<td style="padding:20px; font-family: Arial, sans-serif; color:#333333;">
|
||||
<center>
|
||||
<img src="https://s3.portnimara.com/images/Port%20Nimara%20New%20Logo-Circular%20Frame_250px.png" alt="Port Nimara Logo" width="100" style="margin-bottom:20px;" />
|
||||
</center>
|
||||
<p style="margin-bottom:10px; font-size:16px;">Dear Administrator,</p>
|
||||
<p style="margin-bottom:10px; font-size:16px;">${escapeHtml(fullName)} has expressed their interest in <strong>Port Nimara</strong>. Here are their details:</p>
|
||||
<p style="margin-bottom:0; font-size:16px;"><strong>Name:</strong> ${escapeHtml(fullName)}</p>
|
||||
<p style="margin-bottom:0; font-size:16px;"><strong>Email:</strong> ${escapeHtml(email)}</p>
|
||||
<p style="margin-bottom:0; font-size:16px;"><strong>Telephone:</strong> ${escapeHtml(phone)}</p>
|
||||
<p style="margin:0 0 16px 0; font-size:16px;"><strong>Berths Selected:</strong> ${escapeHtml(mooringDisplay)}</p>
|
||||
<p style="margin-bottom:10px; font-size:16px;">Please visit the <a href="${escapeHtml(crmUrl)}" target="_blank" style="color:#007bff; text-decoration:underline;">Port Nimara CRM</a> to view more information.</p>
|
||||
<p style="font-size:16px;">Thank you,<br/>Port Nimara CRM</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
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, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
Reference in New Issue
Block a user