Corrected moving to doctype for email
diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py
index 1095b56..219f931 100644
--- a/erpnext/crm/doctype/appointment/appointment.py
+++ b/erpnext/crm/doctype/appointment/appointment.py
@@ -8,6 +8,7 @@
from datetime import timedelta
import frappe
+from frappe import _
from frappe.model.document import Document
from frappe.desk.form.assign_to import add as add_assignemnt
@@ -15,10 +16,9 @@
class Appointment(Document):
def find_lead_by_email(self):
- lead_list = frappe.get_list('Lead', filters = {'email_id':self.email}, ignore_permissions = True)
+ lead_list = frappe.get_list('Lead', filters = {'email_id':self.customer_email}, ignore_permissions = True)
if lead_list:
return lead_list[0].name
- self.email = email
return None
def before_insert(self):
@@ -40,9 +40,9 @@
# Set status to unverified
self.status = 'Unverified'
# Send email to confirm
- verify_url = ''.join([frappe.utils.get_url(),'/book-appointment/verify?email=',self.email,'&appoitnment=',self.name])
- message = ''.join(['Please click the following link to confirm your appointment:']+verify_url)
- frappe.sendmail(recipients=[self.email],
+ verify_url = ''.join([frappe.utils.get_url(),'/book-appointment/verify?email=',self.customer_email,'&appoitnment=',self.name])
+ message = ''.join(['Please click the following link to confirm your appointment:',verify_url])
+ frappe.sendmail(recipients=[self.customer_email],
message=message,
subject=_('Appointment Confirmation'))
frappe.msgprint('Please check your email to confirm the appointment')
@@ -54,7 +54,7 @@
cal_event.save()
def set_verified(self,email):
- if not email == self.email:
+ if not email == self.customer_email:
frappe.throw('Email verification failed.')
# Create new lead
self.create_lead()
diff --git a/erpnext/www/book-appointment/index.py b/erpnext/www/book-appointment/index.py
index 67619fc..49b3ffc 100644
--- a/erpnext/www/book-appointment/index.py
+++ b/erpnext/www/book-appointment/index.py
@@ -98,7 +98,7 @@
appointment.customer_phone_number = contact['number']
appointment.customer_skype = contact['skype']
appointment.customer_details = contact['notes']
- appointment.email = contact['email']
+ appointment.customer_email = contact['email']
appointment.status = 'Open'
appointment.insert()