141 lines
8.8 KiB
TypeScript
141 lines
8.8 KiB
TypeScript
/**
|
|
* Request Created Email Template
|
|
*/
|
|
|
|
import { RequestCreatedData } from './types';
|
|
import { getEmailFooter, getEmailHeader, HeaderStyles, getResponsiveStyles, wrapRichText } from './helpers';
|
|
import { getBrandedHeader } from './branding.config';
|
|
|
|
export function getRequestCreatedEmail(data: RequestCreatedData): string {
|
|
return `
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="format-detection" content="telephone=no">
|
|
<title>Request Created Successfully</title>
|
|
${getResponsiveStyles()}
|
|
</head>
|
|
<body style="margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; background-color: #f4f4f4;">
|
|
<table role="presentation" style="width: 100%; border-collapse: collapse; background-color: #f4f4f4;" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td style="padding: 40px 0;">
|
|
<table role="presentation" class="email-container" style="width: 600px; max-width: 100%; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);" cellpadding="0" cellspacing="0">
|
|
<!-- Header -->
|
|
${getEmailHeader(getBrandedHeader({
|
|
title: 'Request Created Successfully',
|
|
...HeaderStyles.info
|
|
}))}
|
|
|
|
<!-- Content -->
|
|
<tr>
|
|
<td class="email-content" style="padding: 40px 30px;">
|
|
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
Dear <strong style="color: #667eea;">${data.initiatorName}</strong>,
|
|
</p>
|
|
|
|
<p style="margin: 0 0 30px; color: #666666; font-size: 16px; line-height: 1.6;">
|
|
Your request has been successfully created and submitted for approval. It has been assigned to <strong>${data.firstApproverName}</strong> for review.
|
|
</p>
|
|
|
|
<!-- Request Details Box -->
|
|
<table role="presentation" style="width: 100%; border-collapse: collapse; background-color: #f8f9fa; border-radius: 6px; margin-bottom: 30px;" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td style="padding: 25px;">
|
|
<h2 style="margin: 0 0 20px; color: #333333; font-size: 18px; font-weight: 600;">Request Summary</h2>
|
|
|
|
<table role="presentation" style="width: 100%; border-collapse: collapse;" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px; width: 140px;">
|
|
<strong>Request ID:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.requestId}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px;">
|
|
<strong>Title:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.requestTitle || 'N/A'}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px;">
|
|
<strong>Request Type:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.requestType}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px;">
|
|
<strong>Priority:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.priority}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px;">
|
|
<strong>Created On:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.requestDate} at ${data.requestTime}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 8px 0; color: #666666; font-size: 14px;">
|
|
<strong>Total Approvers:</strong>
|
|
</td>
|
|
<td style="padding: 8px 0; color: #333333; font-size: 14px;">
|
|
${data.totalApprovers}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- What Happens Next -->
|
|
<div style="padding: 20px; background-color: #e7f3ff; border-left: 4px solid #0066cc; border-radius: 4px; margin-bottom: 30px;">
|
|
<h3 style="margin: 0 0 10px; color: #004085; font-size: 16px; font-weight: 600;">What Happens Next?</h3>
|
|
<ul style="margin: 10px 0 0 0; padding-left: 20px; color: #004085; font-size: 14px; line-height: 1.8;">
|
|
<li>Your request is now with the first approver for review</li>
|
|
<li>You'll receive notifications as approvers take action</li>
|
|
<li>You can track the status and add comments anytime</li>
|
|
<li>Expected TAT: ${data.expectedTAT} hours</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- View Details Button -->
|
|
<table role="presentation" style="width: 100%; border-collapse: collapse; margin-bottom: 20px;" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td style="text-align: center;">
|
|
<a href="${data.viewDetailsLink}" class="cta-button" style="display: inline-block; padding: 15px 40px; background-color: #1a1a1a; color: #ffffff; text-decoration: none; text-align: center; border-radius: 6px; font-size: 16px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); min-width: 200px;">
|
|
View Request Details
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p style="margin: 0; color: #666666; font-size: 14px; line-height: 1.6; text-align: center;">
|
|
Thank you for using the ${data.companyName} Workflow System.
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
|
|
${getEmailFooter(data.companyName)}
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|
|
`;
|
|
}
|
|
|