fix: run after commit only if queue available

This commit is contained in:
Ejaaz Khan 2026-01-05 15:31:17 +05:30
parent 922c1b812d
commit 6861d34e20

View file

@ -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