@@ -39,7 +39,7 @@
{% for vm in vms %}
diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html
new file mode 100644
index 00000000..7991eb69
--- /dev/null
+++ b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html
@@ -0,0 +1,131 @@
+{% load static from staticfiles %}
+
+
+
+
+
+
+
Oxygen Invoice
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ User {{email}} requested beta access
+ {% for vm in vms %}
+ Type: {{vm.type}} - Amount: {{vm.amount}}
+ {% endfor %}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+Your data center light team
+ |
+
+
+ |
+
+
+
+
+
diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt
new file mode 100644
index 00000000..92a03a99
--- /dev/null
+++ b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt
@@ -0,0 +1,131 @@
+{% load static from staticfiles %}
+
+
+
+
+
+
+
Oxygen Invoice
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ User {{email}} requested beta access
+ {% for vm in vms %}
+ Type: {{vm.type}}
+ {% endfor %}
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+Your data center light team
+ |
+
+
+ |
+
+
+
+
+
diff --git a/datacenterlight/views.py b/datacenterlight/views.py
index 44363852..3d012df6 100644
--- a/datacenterlight/views.py
+++ b/datacenterlight/views.py
@@ -35,8 +35,30 @@ class BetaProgramView(CreateView):
def post(self, request, *args, **kwargs):
data = request.POST
- BetaAccessVM.create(data)
+ vms = BetaAccessVM.create(data)
+
+ context = {
+ 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host()),
+ 'email': data.get('email'),
+ 'vms': vms
+ }
+
+ email_data = {
+ 'subject': 'DatacenterLight Beta Access Request',
+ 'to': 'info@ungleich.ch',
+ 'context': context,
+ 'template_name': 'request_beta_access_notification',
+ 'template_path': 'datacenterlight/emails/'
+ }
+ email = BaseEmail(**email_data)
+ email.send()
+
+ messages.add_message(self.request, messages.SUCCESS, self.success_message)
return HttpResponseRedirect(self.get_success_url())
+ # return super(BetaProgramView, self).form_valid(form)
+
+
+
# def form_valid(self, form):
diff --git a/digitalglarus/templates/digitalglarus/emails/password_reset_email.html b/digitalglarus/templates/digitalglarus/emails/password_reset_email.html
index 42562b05..1688af72 100644
--- a/digitalglarus/templates/digitalglarus/emails/password_reset_email.html
+++ b/digitalglarus/templates/digitalglarus/emails/password_reset_email.html
@@ -111,7 +111,7 @@
My Account
-
Reset password link
+
Reset password link