courrier preview

This commit is contained in:
alma 2025-05-01 12:33:30 +02:00
parent 36920bc9d5
commit 0813a70184
2 changed files with 51 additions and 15 deletions

View File

@ -200,16 +200,34 @@ export default function ComposeEmail(props: ComposeEmailProps) {
// Provide a basic template if the content is empty
const { fromStr, toStr, ccStr, dateStr, subject } = getFormattedInfoForEmail(initialEmail);
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>---------------------------- Forwarded Message ----------------------------</div>
</div>
<div><strong>From:</strong> ${fromStr}</div>
<div><strong>Date:</strong> ${dateStr}</div>
<div><strong>Subject:</strong> ${subject || ''}</div>
<div><strong>To:</strong> ${toStr}</div>
${ccStr ? `<div><strong>Cc:</strong> ${ccStr}</div>` : ''}
<div style="border-bottom: 1px solid #ccc; margin-top: 10px; margin-bottom: 15px; padding-bottom: 5px;">
<table style="margin-bottom: 10px; font-size: 14px;">
<tr>
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">From:</td>
<td style="padding: 3px 0;">${fromStr}</td>
</tr>
<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>

View File

@ -338,16 +338,34 @@ export function formatForwardedEmail(originalEmail: EmailMessage | LegacyEmailMe
// Create a traditional forward format with dashed separator
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>---------------------------- Forwarded Message ----------------------------</div>
</div>
<div><strong>From:</strong> ${fromStr}</div>
<div><strong>Date:</strong> ${dateStr}</div>
<div><strong>Subject:</strong> ${subject || ''}</div>
<div><strong>To:</strong> ${toStr}</div>
${ccStr ? `<div><strong>Cc:</strong> ${ccStr}</div>` : ''}
<div style="border-bottom: 1px solid #ccc; margin-top: 10px; margin-bottom: 15px; padding-bottom: 5px;">
<table style="margin-bottom: 10px; font-size: 14px;">
<tr>
<td style="padding: 3px 10px 3px 0; font-weight: bold; text-align: right; vertical-align: top;">From:</td>
<td style="padding: 3px 0;">${fromStr}</td>
</tr>
<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>
@ -358,7 +376,7 @@ export function formatForwardedEmail(originalEmail: EmailMessage | LegacyEmailMe
const cleanHtml = `${forwardHeader}${contentHtml}`;
// Plain text version
// Plain text version - with clearer formatting
const plainText = `
---------------------------- Forwarded Message ----------------------------
From: ${fromStr}