Skip to content

Commit

Permalink
fix: rendering the email template subject in leave notification (back…
Browse files Browse the repository at this point in the history
…port #2027) (#2046)

(cherry picked from commit 816a50e)

Co-authored-by: Nihantra C. Patel <[email protected]>
  • Loading branch information
mergify[bot] and Nihantra-Patel authored Aug 6, 2024
1 parent adeb482 commit 1e576fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hrms/hr/doctype/leave_application/leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ def notify_employee(self):
frappe.msgprint(_("Please set default template for Leave Status Notification in HR Settings."))
return
email_template = frappe.get_doc("Email Template", template)
subject = frappe.render_template(email_template.subject, args)
message = frappe.render_template(email_template.response_, args)

self.notify(
Expand All @@ -587,7 +588,7 @@ def notify_employee(self):
"message": message,
"message_to": employee.user_id,
# for email
"subject": email_template.subject,
"subject": subject,
"notify": "employee",
}
)
Expand All @@ -604,6 +605,7 @@ def notify_leave_approver(self):
)
return
email_template = frappe.get_doc("Email Template", template)
subject = frappe.render_template(email_template.subject, args)
message = frappe.render_template(email_template.response_, args)

self.notify(
Expand All @@ -612,7 +614,7 @@ def notify_leave_approver(self):
"message": message,
"message_to": self.leave_approver,
# for email
"subject": email_template.subject,
"subject": subject,
}
)

Expand Down

0 comments on commit 1e576fc

Please sign in to comment.