fix: Save content_type, multipart information to email message model (#2774)

This commit is contained in:
Pranav Raj S
2021-08-09 18:04:34 +05:30
committed by GitHub
parent 462214aced
commit bdc4ecffc1
5 changed files with 40 additions and 14 deletions

View File

@@ -143,6 +143,7 @@ export default {
const {
email: {
content_type: contentType = '',
html_content: { full: fullHTMLContent, reply: replyHTMLContent } = {},
text_content: { full: fullTextContent, reply: replyTextContent } = {},
} = {},
@@ -156,7 +157,12 @@ export default {
if (contentToBeParsed && this.isIncoming) {
const parsedContent = this.stripStyleCharacters(contentToBeParsed);
if (parsedContent) {
return parsedContent.replace(/\n/g, '<br />');
// This is a temporary fix for line-breaks in text/plain emails
// Now, It is not rendered properly in the email preview.
// FIXME: Remove this once we have a better solution for rendering text/plain emails
return contentType.includes('text/plain')
? parsedContent.replace(/\n/g, '<br />')
: parsedContent;
}
}
return (