Merge pull request #2835 from manassolanki/di_fix

Data Import - User Doctype
This commit is contained in:
Nabin Hait 2017-03-09 14:56:19 +05:30 committed by GitHub
commit 7da8688eea

View file

@ -8,12 +8,14 @@ from frappe import _
from frappe.model.document import Document
from frappe.email.queue import send_one
from frappe.limits import get_limits
from frappe.utils import now_datetime
class EmailQueue(Document):
def set_recipients(self, recipients):
self.set("recipients", [])
for r in recipients:
self.append("recipients", {"recipient":r})
self.append("recipients", {"recipient":r, "status":"Not Sent"})
def on_trash(self):
self.prevent_email_queue_delete()
@ -37,6 +39,9 @@ def retry_sending(name):
doc.status = "Not Sent"
doc.save(ignore_permissions=True)
frappe.db.sql("""update `tabEmail Queue Recipient` set status='Not Sent', modified=%s where parent=%s""",
(now_datetime(), name))
@frappe.whitelist()
def send_now(name):
send_one(name, now=True)