validate the sender email id (#3862)
This commit is contained in:
parent
8dc9645cdb
commit
c9df03b60d
1 changed files with 5 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ from frappe.utils.scheduler import log
|
|||
from frappe.email.queue import send
|
||||
from frappe.email.doctype.email_group.email_group import add_subscribers
|
||||
from frappe.utils import parse_addr
|
||||
from frappe.utils import validate_email_add
|
||||
|
||||
|
||||
class Newsletter(Document):
|
||||
|
|
@ -23,6 +24,10 @@ class Newsletter(Document):
|
|||
from `tabEmail Queue` where reference_doctype=%s and reference_name=%s
|
||||
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"):
|
||||
self.recipients = frappe.utils.split_emails(self.test_email_id)
|
||||
self.queue_all()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue