mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 13:38:27 +00:00
added automatic lead creation for sales email id
This commit is contained in:
@@ -28,16 +28,12 @@ class JobsMailbox(POP3Mailbox):
|
||||
return webnotes.conn.sql("select user from tabSessions where \
|
||||
time_to_sec(timediff(now(), lastupdate)) < 1800")
|
||||
|
||||
def get_existing_application(self, email_id):
|
||||
name = webnotes.conn.sql("""select name from `tabJob Applicant` where
|
||||
email_id = %s""", email_id)
|
||||
return name and name[0][0] or None
|
||||
|
||||
def process_message(self, mail):
|
||||
if mail.from_email == self.settings.email_id:
|
||||
return
|
||||
|
||||
name = self.get_existing_application(mail.from_email)
|
||||
name = webnotes.conn.get_value("Job Applicant", {"email_id": mail.from_email},
|
||||
"name")
|
||||
if name:
|
||||
applicant = webnotes.model_wrapper("Job Applicant", name)
|
||||
if applicant.doc.status!="Rejected":
|
||||
|
||||
Reference in New Issue
Block a user