diff --git a/frappe/email/doctype/email_queue/email_queue.py b/frappe/email/doctype/email_queue/email_queue.py index edccabc174..edbf6879c8 100644 --- a/frappe/email/doctype/email_queue/email_queue.py +++ b/frappe/email/doctype/email_queue/email_queue.py @@ -37,11 +37,11 @@ def retry_sending(name): doc = frappe.get_doc("Email Queue", name) if doc and (doc.status == "Error" or doc.status == "Partially Errored"): doc.status = "Not Sent" + for d in doc.recipients: + if d.status != 'Sent': + d.status = 'Not Sent' doc.save(ignore_permissions=True) - frappe.db.sql("""update `tabEmail Queue Recipient` set status='Not Sent', modified=%s where parent=%s""", - (now_datetime(), name)) - @frappe.whitelist() def send_now(name): send_one(name, now=True)