webnotes/erpnext#869 newsletter to send to employees
This commit is contained in:
parent
81578d2e77
commit
f1c3537924
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-03-07 09:04:18",
|
"creation": "2013-03-07 09:04:18",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2014-01-20 17:48:40",
|
"modified": "2014-02-03 18:06:03",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -457,6 +457,12 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Personal Email"
|
"label": "Personal Email"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "unsubscribed",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Unsubscribed"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "emergency_contact_details",
|
"fieldname": "emergency_contact_details",
|
||||||
|
@ -70,6 +70,8 @@ class DocType():
|
|||||||
|
|
||||||
elif self.doc.send_to_type=="Employee":
|
elif self.doc.send_to_type=="Employee":
|
||||||
self.send_to_doctype = "Employee"
|
self.send_to_doctype = "Employee"
|
||||||
|
self.email_field = "company_email"
|
||||||
|
|
||||||
return webnotes.conn.sql_list("""select
|
return webnotes.conn.sql_list("""select
|
||||||
if(ifnull(company_email, '')!='', company_email, personal_email) as email_id
|
if(ifnull(company_email, '')!='', company_email, personal_email) as email_id
|
||||||
from `tabEmployee` where status='Active'""")
|
from `tabEmployee` where status='Active'""")
|
||||||
@ -94,7 +96,7 @@ class DocType():
|
|||||||
|
|
||||||
send(recipients = self.recipients, sender = sender,
|
send(recipients = self.recipients, sender = sender,
|
||||||
subject = self.doc.subject, message = self.doc.message,
|
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)
|
ref_doctype = self.doc.doctype, ref_docname = self.doc.name)
|
||||||
|
|
||||||
if not webnotes.flags.in_test:
|
if not webnotes.flags.in_test:
|
||||||
|
Loading…
Reference in New Issue
Block a user