diff --git a/components/email/ComposeEmail.tsx b/components/email/ComposeEmail.tsx index 7085332d..f95211a0 100644 --- a/components/email/ComposeEmail.tsx +++ b/components/email/ComposeEmail.tsx @@ -159,8 +159,10 @@ export default function ComposeEmail(props: ComposeEmailProps) { // Provide a basic template if the content is empty const { fromStr, dateStr } = getFormattedInfoForEmail(initialEmail); const fallbackContent = ` -
On ${dateStr}, ${fromStr} wrote:
-
+
+ On ${dateStr}, ${fromStr} wrote: +
+
[Original message content could not be loaded]
`; @@ -198,17 +200,22 @@ 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 = ` -
-
---------- Forwarded message ---------
+
+
+
---------------------------- Forwarded Message ----------------------------
+
From: ${fromStr}
Date: ${dateStr}
Subject: ${subject || ''}
To: ${toStr}
${ccStr ? `
Cc: ${ccStr}
` : ''} +
+
----------------------------------------------------------------------
+
-
+
[Original message content could not be loaded] -
+
`; setEmailContent(fallbackContent); } else { diff --git a/lib/utils/email-utils.ts b/lib/utils/email-utils.ts index 5bb5935a..0f3f434f 100644 --- a/lib/utils/email-utils.ts +++ b/lib/utils/email-utils.ts @@ -279,21 +279,26 @@ export function formatReplyEmail(originalEmail: EmailMessage | LegacyEmailMessag const { text, html } = extractEmailContent(originalEmail); emailText = text; - // Create simple reply with header - const cleanReplyHeader = `
On ${dateStr}, ${fromStr} wrote:
`; + // Create a clearer reply header with separator line + const cleanReplyHeader = ` +
+ On ${dateStr}, ${fromStr} wrote: +
+ `; // No character limit - display the full email content const cleanHtml = ` ${cleanReplyHeader} -
-

${emailText.replace(/\n/g, '

')}

+
+ ${html || `

${emailText.replace(/\n/g, '

')}

`}
`; // Plain text version - no truncation const plainText = ` On ${dateStr}, ${fromStr} wrote: -> ${emailText.split('\n').join('\n> ')} +------------------------------------------------------------------- +${emailText.split('\n').join('\n> ')} `; return { @@ -336,34 +341,40 @@ export function formatForwardedEmail(originalEmail: EmailMessage | LegacyEmailMe const { text, html } = extractEmailContent(originalEmail); emailText = text; - // Create simple forward with metadata header + // Create a more traditional forward format with dashed separator const cleanForwardHeader = ` -
-
---------- Forwarded message ---------
+
+
+
---------------------------- Forwarded Message ----------------------------
+
From: ${fromStr}
Date: ${dateStr}
Subject: ${subject || ''}
To: ${toStr}
${ccStr ? `
Cc: ${ccStr}
` : ''} +
+
----------------------------------------------------------------------
+
`; // No character limit - display the full email content const cleanHtml = ` ${cleanForwardHeader} -
-

${emailText.replace(/\n/g, '

')}

-
+
+ ${html || `

${emailText.replace(/\n/g, '

')}

`} +
`; - // Plain text version + // Plain text version - no truncation const plainText = ` ----------- Forwarded message --------- +---------------------------- Forwarded Message ---------------------------- From: ${fromStr} Date: ${dateStr} Subject: ${subject || ''} To: ${toStr} -${ccStr ? `Cc: ${ccStr}\n` : ''} +${ccStr ? `Cc: ${ccStr}` : ''} +---------------------------------------------------------------------- ${emailText} `;