Skip to content

Commit

Permalink
fix: Sender email in process statements of accounts
Browse files Browse the repository at this point in the history
(cherry picked from commit 65a2f3d)
  • Loading branch information
deepeshgarg007 authored and mergify[bot] committed Mar 10, 2024
1 parent 8b5afbb commit 953f640
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,16 @@ def send_emails(document_name, from_scheduler=False, posting_date=None):
subject = frappe.render_template(doc.subject, context)
message = frappe.render_template(doc.body, context)

if doc.sender:
sender_email = frappe.db.get_value("Email Account", doc.sender, "email_id")
else:
sender_email = frappe.session.user

frappe.enqueue(
queue="short",
method=frappe.sendmail,
recipients=recipients,
sender=doc.sender or frappe.session.user,
sender=sender_email,
cc=cc,
subject=subject,
message=message,
Expand Down

0 comments on commit 953f640

Please sign in to comment.