From 141abf9faf93e01cd53e6ce53140f110d2efe99b Mon Sep 17 00:00:00 2001 From: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com> Date: Thu, 11 Jan 2024 09:57:10 +0530 Subject: [PATCH] fix: set correct recipient when reply to own email (#24256) * fix: set correct recipient when reply to own email When Sender clicks on reply to own email, the recipient is set to the Sender's email address instead of the original ( last_email ) recipient. Added a check if sender is composing a reply to own email and set the recipient to the original ( last_email ) recipient. * Update communication.js Co-authored-by: Ankush Menat --------- Co-authored-by: Ankush Menat --- frappe/public/js/frappe/views/communication.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index fb4fe913c1..1115fce430 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -230,6 +230,10 @@ frappe.views.CommunicationComposer = class { if (!this.forward && !this.recipients && this.last_email) { this.recipients = this.last_email.sender; + // If same user replies to their own email, set recipients to last email recipients + if (this.last_email.sender == this.sender) { + this.recipients = this.last_email.recipients; + } this.cc = this.last_email.cc; this.bcc = this.last_email.bcc; }