blob: 694f7d1201e59a10bca6d6e0f5e1eb25dd09a57c [file] [log] [blame]
Anand Doshi35107642013-10-14 18:59:16 +05301from __future__ import unicode_literals
2import webnotes
Rushabh Mehtaacd33672013-08-26 16:17:50 +05303
Anand Doshi35107642013-10-14 18:59:16 +05304class CustomDocType(DocType):
5 def on_login(self):
6 from webnotes.utils import validate_email_add
7 from webnotes import conf
8 if "demo_notify_url" in conf:
9 if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
10 import requests
11 response = requests.post(conf.demo_notify_url, data={
12 "cmd":"portal.utils.send_message",
13 "subject":"Logged into Demo",
14 "sender": webnotes.form_dict.lead_email,
15 "message": "via demo.erpnext.com"
16 })