From 6861d34e20144210888703767e812868a60e53ff Mon Sep 17 00:00:00 2001 From: Ejaaz Khan Date: Mon, 5 Jan 2026 15:31:17 +0530 Subject: [PATCH] fix: run after commit only if queue available --- frappe/email/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/email/__init__.py b/frappe/email/__init__.py index c73ae65f04..44bb362f8d 100644 --- a/frappe/email/__init__.py +++ b/frappe/email/__init__.py @@ -243,6 +243,6 @@ def sendmail( # build email queue and send the email if send_now is True. q = builder.process(send_now=False) - if now: + if now and q: frappe.db.after_commit.add(q.send) return q