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 <ankushmenat@gmail.com>

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
Maharshi Patel 2024-01-11 09:57:10 +05:30 committed by GitHub
parent 5ef8577cff
commit 141abf9faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}