Merge pull request #6409 from netchampfaris/email-reply-fix

fix: Dont append last email's content in reply
This commit is contained in:
Faris Ansari 2018-11-06 19:03:28 +05:30 committed by GitHub
commit 8f84cc4e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -645,27 +645,10 @@ frappe.views.CommunicationComposer = Class.extend({
var reply = (this.message || "")
+ (signature ? ("<br>" + signature) : "");
var content = '';
if(last_email) {
var last_email_content = last_email.original_comment || last_email.content;
// why do we append the last email in the reply?
var content = "<div><br></div>" + reply;
last_email_content = last_email_content
.replace(/&lt;meta[\s\S]*meta&gt;/g, '') // remove <meta> tags
.replace(/&lt;style[\s\S]*&lt;\/style&gt;/g, ''); // // remove <style> tags
var communication_date = last_email.communication_date || last_email.creation;
content = '<div><br></div>'
+ reply
+ "<br><!-- original-reply --><br>"
+ '<blockquote>' +
'<p>' + __("On {0}, {1} wrote:",
[frappe.datetime.global_date_format(communication_date) , last_email.sender]) + '</p>' +
last_email_content +
'<blockquote>';
} else {
content = "<div><br></div>" + reply;
}
fields.content.set_value(content);
}
});