[fix] Set user_id as Reply-To in birthday reminder emails
This commit is contained in:
parent
a5ac1f024e
commit
3667da1053
@ -208,15 +208,15 @@ def send_birthday_reminders():
|
|||||||
users = [u.email_id or u.name for u in get_enabled_system_users()]
|
users = [u.email_id or u.name for u in get_enabled_system_users()]
|
||||||
|
|
||||||
for e in birthdays:
|
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),
|
subject=_("Birthday Reminder for {0}").format(e.employee_name),
|
||||||
message=_("""Today is {0}'s birthday!""").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)
|
bulk=True)
|
||||||
|
|
||||||
def get_employees_who_are_born_today():
|
def get_employees_who_are_born_today():
|
||||||
"""Get Employee properties whose birthday is 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)
|
from tabEmployee where day(date_of_birth) = day(%(date)s)
|
||||||
and month(date_of_birth) = month(%(date)s)
|
and month(date_of_birth) = month(%(date)s)
|
||||||
and status = 'Active'""", {"date": today()}, as_dict=True)
|
and status = 'Active'""", {"date": today()}, as_dict=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user