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
|
// Use the email service to fetch the email content
|
||||||
const email = await getEmailContent(session.user.id, id, folder);
|
const email = await getEmailContent(session.user.id, id, folder);
|
||||||
|
|
||||||
// Return only what's needed for displaying the email
|
// Return the complete email object instead of just partial data
|
||||||
return NextResponse.json({
|
return NextResponse.json(email);
|
||||||
id,
|
|
||||||
subject: email.subject,
|
|
||||||
content: email.content,
|
|
||||||
contentFetched: true
|
|
||||||
});
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error("Error fetching email content:", error);
|
console.error("Error fetching email content:", error);
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|||||||
@ -135,6 +135,19 @@ export default function ComposeEmail({
|
|||||||
return;
|
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 {
|
try {
|
||||||
// Format subject with Fwd: prefix if needed
|
// Format subject with Fwd: prefix if needed
|
||||||
const subject = initialEmail.subject || "(No subject)";
|
const subject = initialEmail.subject || "(No subject)";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user