diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 70f788e569..11d7af837b 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -254,7 +254,10 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received = recipients = comm.get_recipients() comm.send(print_html, print_format, attachments, send_me_a_copy=send_me_a_copy, recipients=recipients) - return ", ".join(recipients) if recipients else None + return { + "name": comm.name, + "recipients": ", ".join(recipients) if recipients else None + } @frappe.whitelist() def get_convert_to(): diff --git a/frappe/email/doctype/email_account/test_email_account.py b/frappe/email/doctype/email_account/test_email_account.py index f09ae9a0bd..c8c8839e19 100644 --- a/frappe/email/doctype/email_account/test_email_account.py +++ b/frappe/email/doctype/email_account/test_email_account.py @@ -90,7 +90,7 @@ class TestEmailAccount(unittest.TestCase): # send sent_name = make(subject = "Test", content="test content", recipients="test_receiver@example.com", sender="test@example.com", - send_email=True) + send_email=True)["name"] sent_mail = email.message_from_string(frappe.get_last_doc("Bulk Email").message) with open(os.path.join(os.path.dirname(__file__), "test_mails", "reply-1.raw"), "r") as f: diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 7fc317bb9c..8b2924abee 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -328,7 +328,7 @@ frappe.views.CommunicationComposer = Class.extend({ callback: function(r) { if(!r.exc) { if(form_values.send_email) - msgprint(__("Email sent to {0}", [r.message])); + msgprint(__("Email sent to {0}", [r.message["recipients"]])); me.dialog.hide(); if (cur_frm) {