From 97f65762130a5439172dc204ec1ea0027d477d0d Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Fri, 1 Nov 2019 12:36:06 +0530 Subject: [PATCH] prettify confirmation email --- erpnext/crm/doctype/appointment/appointment.py | 9 ++++++++- erpnext/templates/emails/confirm_appointment.html | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 erpnext/templates/emails/confirm_appointment.html diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index 95a9580dbb..b3af99da94 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -43,10 +43,17 @@ class Appointment(Document): 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, + } message = ''.join( ['Please click the following link to confirm your appointment:', verify_url]) frappe.sendmail(recipients=[self.customer_email], - message=message, + template=template, + args=args, subject=_('Appointment Confirmation')) frappe.msgprint( 'Please check your email to confirm the appointment') diff --git a/erpnext/templates/emails/confirm_appointment.html b/erpnext/templates/emails/confirm_appointment.html new file mode 100644 index 0000000000..6c9b28bc13 --- /dev/null +++ b/erpnext/templates/emails/confirm_appointment.html @@ -0,0 +1,10 @@ +

{{_("Dear")}} {{ full_name }}{% if last_name %} {{ last_name}}{% endif %},

+

{{_("A new appointment has been created for you with {0}").format(site_url)}}.

+

{{_("Click on the link below to verify your email and confirm the appointment")}}.

+ +

+ {{ _("Verify Email") }} +

+ +
+

{{_("You can also copy-paste this link in your browser")}} {{ link }}