fix: Use reply content if available (#2025)

* fix: Use text_content reply if available
* Use reply instead of full message from html_content
This commit is contained in:
Pranav Raj S 2021-05-17 11:16:50 +05:30 committed by GitHub
parent d5215fea93
commit ef2611164d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,12 +109,14 @@ export default {
);
const {
email: { html_content: { full: fullHTMLContent } = {} } = {},
email: {
html_content: { full: fullHTMLContent, reply: replyHTMLContent } = {},
} = {},
} = this.contentAttributes;
if (fullHTMLContent && this.isIncoming) {
if ((replyHTMLContent || fullHTMLContent) && this.isIncoming) {
let parsedContent = new DOMParser().parseFromString(
fullHTMLContent || '',
replyHTMLContent || fullHTMLContent || '',
'text/html'
);
if (!parsedContent.getElementsByTagName('parsererror').length) {