mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
webnotes/erpnext#869 newsletter to send to employees
This commit is contained in:
@@ -70,6 +70,8 @@ class DocType():
|
||||
|
||||
elif self.doc.send_to_type=="Employee":
|
||||
self.send_to_doctype = "Employee"
|
||||
self.email_field = "company_email"
|
||||
|
||||
return webnotes.conn.sql_list("""select
|
||||
if(ifnull(company_email, '')!='', company_email, personal_email) as email_id
|
||||
from `tabEmployee` where status='Active'""")
|
||||
@@ -94,7 +96,7 @@ class DocType():
|
||||
|
||||
send(recipients = self.recipients, sender = sender,
|
||||
subject = self.doc.subject, message = self.doc.message,
|
||||
doctype = self.send_to_doctype, email_field = "email_id",
|
||||
doctype = self.send_to_doctype, email_field = self.email_field or "email_id",
|
||||
ref_doctype = self.doc.doctype, ref_docname = self.doc.name)
|
||||
|
||||
if not webnotes.flags.in_test:
|
||||
|
||||
Reference in New Issue
Block a user