diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index 38fdb857..bac700ef 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -48,6 +48,7 @@ export interface Email { to: string; subject: string; content: string; + body?: string; // For backward compatibility date: string; read: boolean; starred: boolean; @@ -1222,7 +1223,7 @@ export default function CourrierPage() { ); - // Update handleReply function + // Update handleReply to include body property for backward compatibility const handleReply = async (type: 'reply' | 'reply-all' | 'forward') => { if (!selectedEmail) return; @@ -1245,6 +1246,12 @@ export default function CourrierPage() { return subject.startsWith('Re:') ? subject : `Re: ${subject}`; }; + // Add body property for backward compatibility + const emailWithBody = { + ...selectedEmail, + body: selectedEmail.content // Add body property that maps to content + }; + // Set the appropriate flags setIsReplying(type === 'reply' || type === 'reply-all'); setIsForwarding(type === 'forward'); @@ -1259,6 +1266,10 @@ export default function CourrierPage() { setShowBcc(false); setAttachments([]); + // Pass the email with both content and body properties + setReplyToEmail(emailWithBody); + setForwardEmail(type === 'forward' ? emailWithBody : null); + } catch (error) { console.error('Error preparing reply:', error); }