From e38df305c4284689749c3ae6c394649ad758c55d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 22:08:25 +0530 Subject: [PATCH] New VM email template updated --- hosting/locale/de/LC_MESSAGES/django.po | 31 +++- .../hosting/emails/new_booked_vm.html | 151 ++---------------- .../hosting/emails/new_booked_vm.txt | 150 ++--------------- hosting/views.py | 10 +- 4 files changed, 59 insertions(+), 283 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 8ee04632..86af85f3 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 11:16+0000\n" +"POT-Creation-Date: 2017-09-02 15:26+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -193,6 +193,31 @@ msgstr "Meine Einstellungen" msgid "Support / Contact" msgstr "Support / Kontakt" +#, python-format +msgid "" +"You have ordered a new virtual machine!
\n" +"Your order of [%(vm.name)s] has been charged.

\n" +"You can view your invoice by clicking the button below.

\n" +msgstr "" +"Du hast eine neue virtuelle Maschine bestellt!
\n" +"Deine Bestellung von [%(vm.name)s] wurde erhoben.

\n" +"Um die Rechnung zu sehen, klicke auf den Button unten.

\n" + +msgid "View Invoice" +msgstr "Zur Rechnung" + +#, python-format +msgid "" +"You have ordered a new virtual machine!\n" +"Your order of [%(vm.name)s] has been charged.\n" +"\n" +"You can view your invoice by clicking the link below.\n" +"\n" +msgstr "" +"Du hast eine neue virtuelle Maschine bestellt!\n" +"Deine Bestellung von [%(vm.name)s] wurde erhoben.\n\n" +"Um die Rechnung zu sehen, klicke auf den Button unten.\n\n" + msgid "Password Reset" msgstr "Passwort zurücksetzen" @@ -535,6 +560,10 @@ msgstr "" msgid "Invalid credit card" msgstr "Ungültige Kreditkarte" +#, python-brace-format +msgid "Your New VM {vm_name} at Data Center Light" +msgstr "Deine neue VM {vm_name} bei Data Center Light" + msgid "Confirm Order" msgstr "Bestellung Bestätigen" diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 0f9b4f6e..34a500bb 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -1,140 +1,13 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- You have booked a virtual machine! -
- Your virtual machine {{vm.name}} subscription has been charged, -
- we are going to contact you as soon your virtual machine has been activated. -
- You can view your invoice clicking on the button below. -
-
-View Invoice +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} +{% load i18n %} +{% block email_head %}{{page_header}}{% endblock %} +{% 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.

+You can view your invoice by clicking the button below.

+{% endblocktrans %} + -
-
-
-
- - -
- ungleich
-
-
-
- - - +{% endblock %} diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 0f9b4f6e..1e7f8aac 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -1,140 +1,12 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- You have booked a virtual machine! -
- Your virtual machine {{vm.name}} subscription has been charged, -
- we are going to contact you as soon your virtual machine has been activated. -
- You can view your invoice clicking on the button below. -
- -
-
-
-
- - -
- ungleich
-
-
-
- - +{% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} +{% load i18n %} +{% 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. +You can view your invoice by clicking the link below. + +{% endblocktrans %} +{{ base_url }}{{order_url}} +{% endblock %} diff --git a/hosting/views.py b/hosting/views.py index a5743e44..d24f18f9 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -652,16 +652,18 @@ class PaymentVMView(LoginRequiredMixin, FormView): vm = VirtualMachineSerializer(manager.get_vm(vm_id)).data - # Send notification to ungleich as soon as VM has been booked + # Send notification to the user as soon as VM has been booked context = { 'vm': vm, 'order': order, 'base_url': "{0}://{1}".format(request.scheme, - request.get_host()) - + request.get_host()), + 'page_header': _( + 'Your New VM {vm_name} at Data Center Light'.format( + vm_name=vm.name)) } email_data = { - 'subject': 'New VM request', + 'subject': context.get('page_header'), 'to': request.user.email, 'context': context, 'template_name': 'new_booked_vm',