From a90a9ed807b9658a5e16cd5502fc5a7d02023d16 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Wed, 26 Jan 2022 09:33:21 +0530 Subject: [PATCH] fix: Remove salutation from email Reasons: - It shows up only when few conditons (which are not very clear) are met. Since the behaviour is not consistent it creates unnecessary confusion - Salutations are not configurable. Not all users want to start their email with "Dear" in which case they have to clear it first. --- frappe/public/js/frappe/form/form.js | 3 +-- frappe/public/js/frappe/views/communication.js | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 1459b38df6..bbc6ecda28 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -1146,8 +1146,7 @@ frappe.ui.form.Form = class FrappeForm { subject: __(this.meta.name) + ': ' + this.docname, recipients: this.doc.email || this.doc.email_id || this.doc.contact_email, attach_document_print: true, - message: message, - real_name: this.doc.real_name || this.doc.contact_display || this.doc.contact_name + message: message }); } diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 1ed79a9758..1d219a7044 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -263,7 +263,6 @@ frappe.views.CommunicationComposer = class { const subject_field = me.dialog.fields_dict.subject; let content = content_field.get_value() || ""; - content = content.split('')[1] || content; content_field.set_value(`${reply.message}
${content}`); subject_field.set_value(reply.subject); @@ -725,15 +724,6 @@ frappe.views.CommunicationComposer = class { message += await this.get_signature(); - const SALUTATION_END_COMMENT = ""; - if (this.real_name && !message.includes(SALUTATION_END_COMMENT)) { - message = ` -

${__('Dear {0},', [this.real_name], 'Salutation in new email')},

- ${SALUTATION_END_COMMENT}
- ${message} - `; - } - if (this.is_a_reply) { message += this.get_earlier_reply(); }