mail page rest
This commit is contained in:
parent
bf4c4400a5
commit
599336ed60
@ -440,8 +440,23 @@ function decodeMimeContent(content: string): string {
|
||||
// Add this helper function
|
||||
const renderEmailContent = (email: Email) => {
|
||||
try {
|
||||
console.log('=== Email Content Debug ===');
|
||||
console.log('Raw email body:', email.body.substring(0, 200) + '...'); // First 200 chars
|
||||
console.log('Email ID:', email.id);
|
||||
console.log('Email subject:', email.subject);
|
||||
|
||||
const parsed = parseFullEmail(email.body) as ParsedEmailContent | ParsedEmailMetadata;
|
||||
console.log('Parsed content type:', 'text' in parsed ? 'ParsedEmailContent' : 'ParsedEmailMetadata');
|
||||
console.log('Parsed content:', {
|
||||
hasText: 'text' in parsed ? !!parsed.text : false,
|
||||
hasHtml: 'html' in parsed ? !!parsed.html : false,
|
||||
hasAttachments: 'attachments' in parsed ? parsed.attachments?.length : 0
|
||||
});
|
||||
|
||||
const content = 'text' in parsed ? parsed.text : ('html' in parsed ? parsed.html || '' : email.body);
|
||||
console.log('Selected content type:', isHtml ? 'HTML' : 'Plain text');
|
||||
console.log('Content preview:', content.substring(0, 100) + '...');
|
||||
|
||||
const isHtml = 'html' in parsed ? !!parsed.html : content.includes('<');
|
||||
|
||||
if (isHtml) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user