Anand Doshi | 3510764 | 2013-10-14 18:59:16 +0530 | [diff] [blame] | 1 | from __future__ import unicode_literals |
| 2 | import webnotes |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 3 | |
Anand Doshi | 3510764 | 2013-10-14 18:59:16 +0530 | [diff] [blame] | 4 | class 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 | }) |