courrier preview
This commit is contained in:
parent
36920bc9d5
commit
0813a70184
@ -200,16 +200,34 @@ export default function ComposeEmail(props: ComposeEmailProps) {
|
|||||||
// Provide a basic template if the content is empty
|
// Provide a basic template if the content is empty
|
||||||
const { fromStr, toStr, ccStr, dateStr, subject } = getFormattedInfoForEmail(initialEmail);
|
const { fromStr, toStr, ccStr, dateStr, subject } = getFormattedInfoForEmail(initialEmail);
|
||||||
const fallbackContent = `
|
const fallbackContent = `
|
||||||
<div style="margin: 20px 0 10px 0; color: #666;">
|
<div style="margin: 20px 0 10px 0; color: #666; font-family: Arial, sans-serif;">
|
||||||
<div style="border-bottom: 1px solid #ccc; margin-bottom: 10px; padding-bottom: 5px;">
|
<div style="border-bottom: 1px solid #ccc; margin-bottom: 10px; padding-bottom: 5px;">
|
||||||
<div>---------------------------- Forwarded Message ----------------------------</div>
|
<div>---------------------------- Forwarded Message ----------------------------</div>
|
||||||
</div>
|
</div>
|
||||||
<div><strong>From:</strong> ${fromStr}</div>
|
<table style="margin-bottom: 10px; font-size: 14px;">
|
||||||
<div><strong>Date:</strong> ${dateStr}</div>
|
<tr>
|
||||||
<div><strong>Subject:</strong> ${subject || ''}</div>
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">From:</td>
|
||||||
<div><strong>To:</strong> ${toStr}</div>
|
<td style="padding: 3px 0;">${fromStr}</td>
|
||||||
${ccStr ? `<div><strong>Cc:</strong> ${ccStr}</div>` : ''}
|
</tr>
|
||||||
<div style="border-bottom: 1px solid #ccc; margin-top: 10px; margin-bottom: 15px; padding-bottom: 5px;">
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Date:</td>
|
||||||
|
<td style="padding: 3px 0;">${dateStr}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Subject:</td>
|
||||||
|
<td style="padding: 3px 0;">${subject || ''}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">To:</td>
|
||||||
|
<td style="padding: 3px 0;">${toStr}</td>
|
||||||
|
</tr>
|
||||||
|
${ccStr ? `
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Cc:</td>
|
||||||
|
<td style="padding: 3px 0;">${ccStr}</td>
|
||||||
|
</tr>` : ''}
|
||||||
|
</table>
|
||||||
|
<div style="border-bottom: 1px solid #ccc; margin-top: 5px; margin-bottom: 15px; padding-bottom: 5px;">
|
||||||
<div>----------------------------------------------------------------------</div>
|
<div>----------------------------------------------------------------------</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -338,16 +338,34 @@ export function formatForwardedEmail(originalEmail: EmailMessage | LegacyEmailMe
|
|||||||
|
|
||||||
// Create a traditional forward format with dashed separator
|
// Create a traditional forward format with dashed separator
|
||||||
const forwardHeader = `
|
const forwardHeader = `
|
||||||
<div style="margin: 20px 0 10px 0; color: #666;">
|
<div style="margin: 20px 0 10px 0; color: #666; font-family: Arial, sans-serif;">
|
||||||
<div style="border-bottom: 1px solid #ccc; margin-bottom: 10px; padding-bottom: 5px;">
|
<div style="border-bottom: 1px solid #ccc; margin-bottom: 10px; padding-bottom: 5px;">
|
||||||
<div>---------------------------- Forwarded Message ----------------------------</div>
|
<div>---------------------------- Forwarded Message ----------------------------</div>
|
||||||
</div>
|
</div>
|
||||||
<div><strong>From:</strong> ${fromStr}</div>
|
<table style="margin-bottom: 10px; font-size: 14px;">
|
||||||
<div><strong>Date:</strong> ${dateStr}</div>
|
<tr>
|
||||||
<div><strong>Subject:</strong> ${subject || ''}</div>
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">From:</td>
|
||||||
<div><strong>To:</strong> ${toStr}</div>
|
<td style="padding: 3px 0;">${fromStr}</td>
|
||||||
${ccStr ? `<div><strong>Cc:</strong> ${ccStr}</div>` : ''}
|
</tr>
|
||||||
<div style="border-bottom: 1px solid #ccc; margin-top: 10px; margin-bottom: 15px; padding-bottom: 5px;">
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Date:</td>
|
||||||
|
<td style="padding: 3px 0;">${dateStr}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Subject:</td>
|
||||||
|
<td style="padding: 3px 0;">${subject || ''}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">To:</td>
|
||||||
|
<td style="padding: 3px 0;">${toStr}</td>
|
||||||
|
</tr>
|
||||||
|
${ccStr ? `
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">Cc:</td>
|
||||||
|
<td style="padding: 3px 0;">${ccStr}</td>
|
||||||
|
</tr>` : ''}
|
||||||
|
</table>
|
||||||
|
<div style="border-bottom: 1px solid #ccc; margin-top: 5px; margin-bottom: 15px; padding-bottom: 5px;">
|
||||||
<div>----------------------------------------------------------------------</div>
|
<div>----------------------------------------------------------------------</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -358,7 +376,7 @@ export function formatForwardedEmail(originalEmail: EmailMessage | LegacyEmailMe
|
|||||||
|
|
||||||
const cleanHtml = `${forwardHeader}${contentHtml}`;
|
const cleanHtml = `${forwardHeader}${contentHtml}`;
|
||||||
|
|
||||||
// Plain text version
|
// Plain text version - with clearer formatting
|
||||||
const plainText = `
|
const plainText = `
|
||||||
---------------------------- Forwarded Message ----------------------------
|
---------------------------- Forwarded Message ----------------------------
|
||||||
From: ${fromStr}
|
From: ${fromStr}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user