From 75b26cc96bc08694f0ab038e52040b6ee925cad2 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 13 Jul 2023 16:15:25 +0530 Subject: [PATCH] revert: do not create comm on auto repeat #20606 --- frappe/automation/doctype/auto_repeat/auto_repeat.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frappe/automation/doctype/auto_repeat/auto_repeat.py b/frappe/automation/doctype/auto_repeat/auto_repeat.py index 1bb3f7c51f..19952bdc9b 100644 --- a/frappe/automation/doctype/auto_repeat/auto_repeat.py +++ b/frappe/automation/doctype/auto_repeat/auto_repeat.py @@ -12,6 +12,8 @@ from frappe.contacts.doctype.contact.contact import ( get_contacts_linked_from, get_contacts_linking_to, ) +from frappe.core.doctype.communication.email import make +from frappe.desk.form import assign_to from frappe.model.document import Document from frappe.utils import ( add_days, @@ -372,14 +374,14 @@ class AutoRepeat(Document): elif "{" in self.message: message = frappe.render_template(self.message, {"doc": new_doc}) - frappe.sendmail( - reference_doctype=new_doc.doctype, - reference_name=new_doc.name, + make( + doctype=new_doc.doctype, + name=new_doc.name, recipients=self.recipients, subject=subject, content=message, attachments=attachments, - expose_recipients="header", + send_email=1, ) @frappe.whitelist()