From 4df9a203f0019dfd1faacaf1be5c47cb5b2eb073 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Tue, 29 Dec 2020 14:14:29 +0530 Subject: [PATCH 1/2] feat: fetch email account signature in email dialog --- frappe/public/js/frappe/views/communication.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 29b21242af..fe14ad4793 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -464,6 +464,7 @@ frappe.views.CommunicationComposer = Class.extend({ }, send_action: function() { + debugger; var me = this; var btn = me.dialog.get_primary_btn(); @@ -625,10 +626,19 @@ frappe.views.CommunicationComposer = Class.extend({ } }, - setup_earlier_reply: function() { + get_default_outgoing_email_account_signature: function() { + return frappe.db.get_value('Email Account', { 'default_outgoing': 1, 'add_signature': 1 }, 'signature'); + }, + + setup_earlier_reply: async function() { let fields = this.dialog.fields_dict; let signature = frappe.boot.user.email_signature || ""; + if (!signature) { + const res = await this.get_default_outgoing_email_account_signature(); + signature = res.message.signature; + } + if(!frappe.utils.is_html(signature)) { signature = signature.replace(/\n/g, "
"); } From 1591cee1457b51d1d58765abd92afbd435b5cfac Mon Sep 17 00:00:00 2001 From: Saqib Date: Wed, 6 Jan 2021 17:08:57 +0530 Subject: [PATCH 2/2] fix: remove debugger --- frappe/public/js/frappe/views/communication.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index fe14ad4793..e974cd52ed 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -464,7 +464,6 @@ frappe.views.CommunicationComposer = Class.extend({ }, send_action: function() { - debugger; var me = this; var btn = me.dialog.get_primary_btn(); @@ -719,4 +718,3 @@ frappe.views.CommunicationComposer = Class.extend({ return text.replace(/\n{3,}/g, '\n\n'); } }); -