@@ -254,7 +254,10 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received = | |||||
recipients = comm.get_recipients() | recipients = comm.get_recipients() | ||||
comm.send(print_html, print_format, attachments, send_me_a_copy=send_me_a_copy, recipients=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() | @frappe.whitelist() | ||||
def get_convert_to(): | def get_convert_to(): | ||||
@@ -90,7 +90,7 @@ class TestEmailAccount(unittest.TestCase): | |||||
# send | # send | ||||
sent_name = make(subject = "Test", content="test content", | sent_name = make(subject = "Test", content="test content", | ||||
recipients="test_receiver@example.com", sender="test@example.com", | 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) | 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: | with open(os.path.join(os.path.dirname(__file__), "test_mails", "reply-1.raw"), "r") as f: | ||||
@@ -328,7 +328,7 @@ frappe.views.CommunicationComposer = Class.extend({ | |||||
callback: function(r) { | callback: function(r) { | ||||
if(!r.exc) { | if(!r.exc) { | ||||
if(form_values.send_email) | if(form_values.send_email) | ||||
msgprint(__("Email sent to {0}", [r.message])); | |||||
msgprint(__("Email sent to {0}", [r.message["recipients"]])); | |||||
me.dialog.hide(); | me.dialog.hide(); | ||||
if (cur_frm) { | if (cur_frm) { | ||||