[fix] Set user_id as Reply-To in birthday reminder emails
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 12c49c8..e781532 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -208,15 +208,15 @@
users = [u.email_id or u.name for u in get_enabled_system_users()]
for e in birthdays:
- frappe.sendmail(recipients=filter(lambda u: u not in (e.company_email, e.personal_email), users),
+ frappe.sendmail(recipients=filter(lambda u: u not in (e.company_email, e.personal_email, e.user_id), users),
subject=_("Birthday Reminder for {0}").format(e.employee_name),
message=_("""Today is {0}'s birthday!""").format(e.employee_name),
- reply_to=e.company_email or e.personal_email,
+ reply_to=e.company_email or e.personal_email or e.user_id,
bulk=True)
def get_employees_who_are_born_today():
"""Get Employee properties whose birthday is today."""
- return frappe.db.sql("""select name, personal_email, company_email, employee_name
+ return frappe.db.sql("""select name, personal_email, company_email, user_id, employee_name
from tabEmployee where day(date_of_birth) = day(%(date)s)
and month(date_of_birth) = month(%(date)s)
and status = 'Active'""", {"date": today()}, as_dict=True)