From d1ee962d4b7e94518f1dc897660d064c6eac4169 Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Tue, 5 Nov 2019 14:53:36 +0530 Subject: [PATCH] seperate function for sending confirmation --- .../crm/doctype/appointment/appointment.py | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index fa4b7ec401..9e051f607a 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -42,20 +42,21 @@ class Appointment(Document): # Set status to unverified self.status = 'Unverified' # Send email to confirm - verify_url = self._get_verify_url() - template = 'confirm_appointment' - args = { - "link":verify_url, - "site_url":frappe.utils.get_url(), - "full_name":self.customer_name, - } - frappe.sendmail(recipients=[self.customer_email], - template=template, - args=args, - subject=_('Appointment Confirmation')) - frappe.msgprint( - 'Please check your email to confirm the appointment') + def send_confirmation_email() + verify_url = self._get_verify_url() + template = 'confirm_appointment' + args = { + "link":verify_url, + "site_url":frappe.utils.get_url(), + "full_name":self.customer_name, + } + frappe.sendmail(recipients=[self.customer_email], + template=template, + args=args, + subject=_('Appointment Confirmation')) + frappe.msgprint( + 'Please check your email to confirm the appointment') def on_change(self): # Sync Calendar