Skip to content

Commit

Permalink
fix: don't enqueue sendmail jobs (#22154)
Browse files Browse the repository at this point in the history
- sendmail just creates email queue, it should be done on the fly.
- if OutgoingEmailError occurs then skip all future ones.

(cherry picked from commit 89c0c1b)

Co-authored-by: Ankush Menat <ankush@frappe.io>


[skip ci]
  • Loading branch information
mergify[bot] committed Aug 22, 2023
1 parent 9c7b92e commit ee2bb42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frappe/workflow/doctype/workflow_action/workflow_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,12 @@ def send_workflow_action_email(users_data, doc):
"reference_doctype": doc.doctype,
}
email_args.update(common_args)
enqueue(method=frappe.sendmail, queue="short", **email_args)
try:
frappe.sendmail(**email_args)
except frappe.OutgoingEmailError:
# Emails config broken, don't bother retrying next user.
frappe.log_error("Failed to send workflow action email")
return


def deduplicate_actions(action_list):
Expand Down

0 comments on commit ee2bb42

Please sign in to comment.