Browse Source

validate the sender email id (#3862)

version-14
Manas Solanki 8 years ago
committed by Rushabh Mehta
parent
commit
c9df03b60d
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      frappe/email/doctype/newsletter/newsletter.py

+ 5
- 0
frappe/email/doctype/newsletter/newsletter.py View File

@@ -14,6 +14,7 @@ from frappe.utils.scheduler import log
from frappe.email.queue import send from frappe.email.queue import send
from frappe.email.doctype.email_group.email_group import add_subscribers from frappe.email.doctype.email_group.email_group import add_subscribers
from frappe.utils import parse_addr from frappe.utils import parse_addr
from frappe.utils import validate_email_add




class Newsletter(Document): class Newsletter(Document):
@@ -23,6 +24,10 @@ class Newsletter(Document):
from `tabEmail Queue` where reference_doctype=%s and reference_name=%s from `tabEmail Queue` where reference_doctype=%s and reference_name=%s
group by status""", (self.doctype, self.name))) or None group by status""", (self.doctype, self.name))) or None


def validate(self):
if self.send_from:
validate_email_add(self.send_from, True)

def test_send(self, doctype="Lead"): def test_send(self, doctype="Lead"):
self.recipients = frappe.utils.split_emails(self.test_email_id) self.recipients = frappe.utils.split_emails(self.test_email_id)
self.queue_all() self.queue_all()


Loading…
Cancel
Save