panel 2 courier api restore

This commit is contained in:
alma 2025-04-26 10:35:34 +02:00
parent 353cb6c51c
commit f21f626497
2 changed files with 15 additions and 7 deletions

View File

@ -39,13 +39,8 @@ export async function GET(
// Use the email service to fetch the email content
const email = await getEmailContent(session.user.id, id, folder);
// Return only what's needed for displaying the email
return NextResponse.json({
id,
subject: email.subject,
content: email.content,
contentFetched: true
});
// Return the complete email object instead of just partial data
return NextResponse.json(email);
} catch (error: any) {
console.error("Error fetching email content:", error);
return NextResponse.json(

View File

@ -135,6 +135,19 @@ export default function ComposeEmail({
return;
}
// Debug log to see the structure of the email object
console.log('Forwarding email object:', JSON.stringify({
id: initialEmail.id,
subject: initialEmail.subject,
from: initialEmail.from,
to: initialEmail.to,
date: initialEmail.date,
hasContent: !!initialEmail.content,
hasHTML: !!initialEmail.html,
hasText: !!initialEmail.text,
contentFetched: initialEmail.contentFetched
}, null, 2));
try {
// Format subject with Fwd: prefix if needed
const subject = initialEmail.subject || "(No subject)";