raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn']
else:
clear_user_creds(wsgi_request,user_email)
- subject = 'Slice created'
- msg = 'A manager of your institution has validated your slice request. You can now add resources to the slice and start experimenting.'
- send_mail(subject, msg, 'support@onelab.eu',[user_email], fail_silently=False)
+
+ try:
+ theme.template_name = 'slice_request_validated.txt'
+ text_content = render_to_string(theme.template, request)
+ theme.template_name = 'slice_request_validated.html'
+ html_content = render_to_string(theme.template, request)
+
+ theme.template_name = 'email_default_sender.txt'
+ sender = render_to_string(theme.template, request)
+ sender = sender.replace('\n', '')
+
+ subject = 'Slice request validated'
+
+ msg = EmailMultiAlternatives(subject, text_content, sender, [user_email])
+ msg.attach_alternative(html_content, "text/html")
+ msg.send()
+ except Exception, e:
+ print "Failed to send email, please check the mail templates and the SMTP configuration of your server"
return results
--- /dev/null
+<img src="{{ STATIC_URL }}img/onelab.png">
+<br>
+<p>Dear OneLab user,</p>
+<p></p>
+<p>You have recently requested a slice in the OneLab portal.</p>
+<br>
+<b>Slice name :</b> {{slice_name}}<br>
+<b>URL :</b> {{number_of_nodes}}<br>
+<b>Purpose :</b> {{purpose}}<br>
+<p></p>
+<p>We are glad to inform you that, a manager of your institution has validated your slice request. You can now add resources to the slice and start experimenting.</p>
+<p></p>
+<p>On behalf of the entire team, I wish you a fruitful user experience on OneLab.</p>
+<p></p>
+<p>Yours sincerely,</p>
+
+<p>Timur Friedman</p>
+<p>Executive Director</p>
+
+
--- /dev/null
+Dear OneLab user,
+
+You have recently requested a slice in the OneLab portal.
+
+Slice name : {{slice_name}}
+URL : {{number_of_nodes}}
+Purpose : {{purpose}}
+
+We are glad to inform you that, a manager of your institution has validated your slice request. You can now add resources to the slice and start experimenting.
+
+On behalf of the entire team, I wish you a fruitful user experience on OneLab.
+
+Yours sincerely,
+
+Timur Friedman
+Executive Director
+
+