panel 2 courier api restore
This commit is contained in:
parent
353cb6c51c
commit
f21f626497
@ -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(
|
||||
|
||||
@ -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)";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user