added automatic lead creation for sales email id

This commit is contained in:
Rushabh Mehta
2013-01-16 11:34:26 +05:30
parent 9942987c9c
commit 2e5db35856
18 changed files with 284 additions and 101 deletions

View File

@@ -0,0 +1,12 @@
// For license information, please see license.txt
cur_frm.cscript = {
refresh: function(doc) {
cur_frm.set_intro("");
if(doc.extract_emails) {
cur_frm.set_intro(wn._("Active: Will extract emails from ") + doc.email_id);
} else {
cur_frm.set_intro(wn._("Not Active"));
}
}
}

View File

@@ -0,0 +1,17 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
from webnotes.utils import cint
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def validate(self):
if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \
self.doc.username and self.doc.password):
webnotes.msgprint(_("""Host, Email and Password required if emails are to be pulled"""),
raise_exception=True)

View File

@@ -0,0 +1,89 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2013-01-16 10:25:26",
"modified_by": "Administrator",
"modified": "2013-01-16 10:25:26"
},
{
"issingle": 1,
"description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
"doctype": "DocType",
"module": "Setup",
"name": "__common__"
},
{
"name": "__common__",
"parent": "Sales Email Settings",
"doctype": "DocField",
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "fields"
},
{
"parent": "Sales Email Settings",
"read": 1,
"name": "__common__",
"create": 1,
"doctype": "DocPerm",
"write": 1,
"parenttype": "DocType",
"role": "System Manager",
"permlevel": 0,
"parentfield": "permissions"
},
{
"name": "Sales Email Settings",
"doctype": "DocType"
},
{
"description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
"doctype": "DocField",
"label": "POP3 Mail Settings",
"fieldname": "pop3_mail_settings",
"fieldtype": "Section Break"
},
{
"description": "Check to activate",
"doctype": "DocField",
"label": "Extract Emails",
"fieldname": "extract_emails",
"fieldtype": "Check"
},
{
"description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"",
"doctype": "DocField",
"label": "Email Id",
"fieldname": "email_id",
"fieldtype": "Data"
},
{
"description": "POP3 server e.g. (pop.gmail.com)",
"doctype": "DocField",
"label": "Host",
"fieldname": "host",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Use SSL",
"fieldname": "use_ssl",
"fieldtype": "Check"
},
{
"doctype": "DocField",
"label": "Username",
"fieldname": "username",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Password",
"fieldname": "password",
"fieldtype": "Password"
},
{
"doctype": "DocPerm"
}
]