From 3667da1053aed4ac6f8464f3cd91d399ccbaa472 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 16 Nov 2015 19:29:48 +0530 Subject: [PATCH] [fix] Set user_id as Reply-To in birthday reminder emails --- erpnext/hr/doctype/employee/employee.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 12c49c8356..e781532e10 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -208,15 +208,15 @@ def send_birthday_reminders(): 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)