panel 2 courier
This commit is contained in:
parent
5f17baf88e
commit
806ddaa73e
@ -77,10 +77,8 @@ export async function GET(request: Request) {
|
||||
envelope: true,
|
||||
flags: true,
|
||||
bodyStructure: true,
|
||||
bodyParts: [
|
||||
'text/plain',
|
||||
'text/html'
|
||||
]
|
||||
source: true, // Get the full email source
|
||||
bodyParts: ['text/plain', 'text/html'] // Get both text and HTML content
|
||||
});
|
||||
|
||||
for await (const message of messages) {
|
||||
@ -88,8 +86,7 @@ export async function GET(request: Request) {
|
||||
let content = '';
|
||||
if (message.bodyParts) {
|
||||
// Prefer HTML content if available
|
||||
content = message.bodyParts.get('text/html')?.toString() ||
|
||||
message.bodyParts.get('text/plain')?.toString() || '';
|
||||
content = message.bodyParts.get('text/html')?.toString() || message.bodyParts.get('text/plain')?.toString() || '';
|
||||
}
|
||||
|
||||
result.push({
|
||||
@ -104,7 +101,8 @@ export async function GET(request: Request) {
|
||||
folder: mailbox.path,
|
||||
hasAttachments: message.bodyStructure?.type === 'multipart',
|
||||
flags: Array.from(message.flags),
|
||||
content: content
|
||||
content: content,
|
||||
source: message.source?.toString() || '' // Include full email source for parsing
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user