Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rendering the email template subject in leave notification (backport #2027) #2046

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading