From f041a4047d579167efec3176960e9572ad10d9a1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 3 Sep 2017 02:33:05 +0530 Subject: [PATCH] Started with VM cancellation template --- .../templates/hosting/emails/vm_canceled.html | 14 ++ ...vm_status_changed.html => vm_canceled.txt} | 0 .../hosting/emails/vm_status_changed.txt | 136 ------------------ hosting/views.py | 10 +- 4 files changed, 20 insertions(+), 140 deletions(-) create mode 100644 hosting/templates/hosting/emails/vm_canceled.html rename hosting/templates/hosting/emails/{vm_status_changed.html => vm_canceled.txt} (100%) delete mode 100644 hosting/templates/hosting/emails/vm_status_changed.txt diff --git a/hosting/templates/hosting/emails/vm_canceled.html b/hosting/templates/hosting/emails/vm_canceled.html new file mode 100644 index 00000000..8f10ccda --- /dev/null +++ b/hosting/templates/hosting/emails/vm_canceled.html @@ -0,0 +1,14 @@ +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} +{% load i18n %} +{% block email_head %}{{page_header}}{% endblock %} +{% block email_body %} +{% url 'hosting:virtual_machines' as my_virtual_machines_url %} +{% blocktrans with vm.name as vm_name %}You're receiving this mail because your virtual machine [{{vm_name}}] has been cancelled.
+You can see your order status by clicking [my VM page] below. +If you want to order a new virtual machine, you can do it by clicking this link []. + +Visit [my VM page] Now + +{% endblocktrans %} +{% endblock %} + diff --git a/hosting/templates/hosting/emails/vm_status_changed.html b/hosting/templates/hosting/emails/vm_canceled.txt similarity index 100% rename from hosting/templates/hosting/emails/vm_status_changed.html rename to hosting/templates/hosting/emails/vm_canceled.txt diff --git a/hosting/templates/hosting/emails/vm_status_changed.txt b/hosting/templates/hosting/emails/vm_status_changed.txt deleted file mode 100644 index c60ba661..00000000 --- a/hosting/templates/hosting/emails/vm_status_changed.txt +++ /dev/null @@ -1,136 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- Your virtual machine {{vm.name}} status has been updated to {{vm.get_status_display}} -
- You can manage your vm clicking on the button below -
- -
-
-
-
- - -
- ungleich
-
-
-
- - - diff --git a/hosting/views.py b/hosting/views.py index 92a40fac..ed72d8f6 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -895,14 +895,16 @@ class VirtualMachineView(LoginRequiredMixin, View): context = { 'vm': vm, 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()) + self.request.get_host()), + 'page_header': _('Virtual Machine Cancellation') } email_data = { - 'subject': 'Virtual machine plan canceled', + 'subject': context['page_header'], 'to': self.request.user.email, 'context': context, - 'template_name': 'vm_status_changed', - 'template_path': 'hosting/emails/' + 'template_name': 'vm_canceled', + 'template_path': 'hosting/emails/', + 'from_address': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send()