Merge pull request #35650 from iamejaaz/email-after-commit-issue

fix: run after commit only if queue available
This commit is contained in:
Ejaaz Khan 2026-01-05 15:42:36 +05:30 committed by GitHub
commit 3642b94cf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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