mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
Merge branch 'wsgi' of github.com:webnotes/erpnext into wsgi
This commit is contained in:
@@ -76,14 +76,17 @@ class DocType():
|
||||
sender = self.doc.send_from or webnotes.utils.get_formatted_email(self.doc.owner)
|
||||
|
||||
from webnotes.utils.email_lib.bulk import send
|
||||
webnotes.conn.auto_commit_on_many_writes = True
|
||||
|
||||
if not webnotes.flags.in_test:
|
||||
webnotes.conn.auto_commit_on_many_writes = True
|
||||
|
||||
send(recipients = self.recipients, sender = sender,
|
||||
subject = self.doc.subject, message = self.doc.message,
|
||||
doctype = self.send_to_doctype, email_field = "email_id",
|
||||
ref_doctype = self.doc.doctype, ref_docname = self.doc.name)
|
||||
|
||||
webnotes.conn.auto_commit_on_many_writes = False
|
||||
if not webnotes.flags.in_test:
|
||||
webnotes.conn.auto_commit_on_many_writes = False
|
||||
|
||||
def validate_send(self):
|
||||
if self.doc.fields.get("__islocal"):
|
||||
|
||||
@@ -45,20 +45,23 @@ test_records =[
|
||||
"subject": "_Test Newsletter to Lead",
|
||||
"send_to_type": "Lead",
|
||||
"lead_source": "All",
|
||||
"message": "This is a test newsletter"
|
||||
"message": "This is a test newsletter",
|
||||
"send_from": "admin@example.com"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Newsletter",
|
||||
"subject": "_Test Newsletter to Contact",
|
||||
"send_to_type": "Contact",
|
||||
"contact_type": "Customer",
|
||||
"message": "This is a test newsletter"
|
||||
"message": "This is a test newsletter",
|
||||
"send_from": "admin@example.com"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Newsletter",
|
||||
"subject": "_Test Newsletter to Custom",
|
||||
"send_to_type": "Custom",
|
||||
"email_list": "test_custom@example.com, test_custom1@example.com, test_custom2@example.com",
|
||||
"message": "This is a test newsletter"
|
||||
"message": "This is a test newsletter",
|
||||
"send_from": "admin@example.com"
|
||||
}],
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user