From b5120040d33b526d2be2dfbac9136e53c5dd0c1b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 22:47:31 +0530 Subject: [PATCH] Fixed an error and from address in new vm email template --- hosting/templates/hosting/emails/new_booked_vm.html | 2 +- hosting/templates/hosting/emails/new_booked_vm.txt | 2 +- hosting/views.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 34a500bb..00430dd5 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -4,7 +4,7 @@ {% block email_body %} {% url 'hosting:orders' order.id as order_url %} {% blocktrans %}You have ordered a new virtual machine!
-Your order of [{{vm.name}}] has been charged.

+Your order of [{{vm|get_value_from_dict:'name'}}] has been charged.

You can view your invoice by clicking the button below.

{% endblocktrans %}
diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 1e7f8aac..3c8b06ad 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -3,7 +3,7 @@ {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} {% blocktrans %}You have ordered a new virtual machine! -Your order of [{{vm.name}}] has been charged. +Your order of [{{vm|get_value_from_dict:'name'}}] has been charged. You can view your invoice by clicking the link below. diff --git a/hosting/views.py b/hosting/views.py index d24f18f9..465b8419 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -660,14 +660,15 @@ class PaymentVMView(LoginRequiredMixin, FormView): request.get_host()), 'page_header': _( 'Your New VM {vm_name} at Data Center Light'.format( - vm_name=vm.name)) + vm_name=vm.get('name'))) } email_data = { 'subject': context.get('page_header'), 'to': request.user.email, 'context': context, 'template_name': 'new_booked_vm', - 'template_path': 'hosting/emails/' + 'template_path': 'hosting/emails/', + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send()