Skip to content

Commit

Permalink
fix: rendering the email template subject in leave notification (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nihantra-Patel authored Aug 6, 2024
1 parent 559ef06 commit 816a50e
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 @@ -597,6 +597,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 @@ -605,7 +606,7 @@ def notify_employee(self):
"message": message,
"message_to": employee_email,
# for email
"subject": email_template.subject,
"subject": subject,
"notify": "employee",
}
)
Expand All @@ -622,6 +623,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 @@ -630,7 +632,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 816a50e

Please sign in to comment.