courrier multi account restore compose
This commit is contained in:
parent
86a5887e83
commit
38d11a5dfd
@ -118,24 +118,30 @@ export default function EmailPreview({ email, loading = false, onReply }: EmailP
|
||||
// Get the content in order of preference
|
||||
let content = '';
|
||||
|
||||
if (email.formattedContent) {
|
||||
console.log('EmailPreview: Using formattedContent');
|
||||
content = email.formattedContent;
|
||||
if (email.content && typeof email.content === 'object') {
|
||||
console.log('EmailPreview: Using object content:', email.content);
|
||||
content = email.content.html || email.content.text || '';
|
||||
} else if (typeof email.content === 'string') {
|
||||
console.log('EmailPreview: Using direct string content');
|
||||
content = email.content;
|
||||
} else if (email.content && typeof email.content === 'object') {
|
||||
console.log('EmailPreview: Using object content:', email.content);
|
||||
content = email.content.html || email.content.text || '';
|
||||
} else {
|
||||
console.log('EmailPreview: Using fallback content');
|
||||
content = email.html || email.text || '';
|
||||
} else if (email.html) {
|
||||
console.log('EmailPreview: Using html content');
|
||||
content = email.html;
|
||||
} else if (email.text) {
|
||||
console.log('EmailPreview: Using text content');
|
||||
content = email.text;
|
||||
} else if (email.formattedContent) {
|
||||
console.log('EmailPreview: Using formattedContent');
|
||||
content = email.formattedContent;
|
||||
}
|
||||
|
||||
console.log('EmailPreview: Content before sanitization:', content);
|
||||
|
||||
// Sanitize the content for display
|
||||
const sanitizedContent = DOMPurify.sanitize(content);
|
||||
const sanitizedContent = DOMPurify.sanitize(content, {
|
||||
ADD_TAGS: ['style'],
|
||||
ADD_ATTR: ['class', 'style']
|
||||
});
|
||||
|
||||
console.log('EmailPreview: Final sanitized content:', sanitizedContent);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user