diff --git a/frappe/email/queue.py b/frappe/email/queue.py index e0aa112e60..24767e4ea0 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -183,6 +183,8 @@ def get_queue(): def retry_sending_emails(): + from frappe.email.doctype.email_queue.email_queue import get_email_retry_limit + emails_in_sending = frappe.get_all( "Email Queue", filters={"status": "Sending"}, fields=["name", "modified"] ) @@ -193,7 +195,7 @@ def retry_sending_emails(): sent_to_atleast_one_recipient = any( rec.recipient for rec in email_queue.recipients if rec.is_mail_sent() ) - if email_queue.retry < cint(frappe.db.get_system_setting("email_retry_limit")) or 3: + if email_queue.retry < get_email_retry_limit(): update_fields.update( { "status": "Partially Sent" if sent_to_atleast_one_recipient else "Not Sent",