if not results:
raise Exception, "Could not create %s. Already exists ?" % sfa_user_params['user_hrn']
else:
- subject = 'User validated'
- msg = 'A manager of your institution has validated your account. You have now full user access to the portal.'
- send_mail(subject, msg, 'support@onelab.eu',[request['email']], fail_silently=False)
+ try:
+ theme.template_name = 'user_request_validated.txt'
+ text_content = render_to_string(theme.template, request)
+ theme.template_name = 'user_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 = 'User validated'
+
+ msg = EmailMultiAlternatives(subject, text_content, sender, [request['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
def create_user(wsgi_request, request, namespace = None, as_admin = False):
--- /dev/null
+<img src="https://onelab.eu/templates/onelab2/images/logo.png">
+<br>
+<p>Dear {{first_name}} {{last_name}},</p>
+<p></p>
+<p>It is my pleasure to welcome you as a fully signed up user of the OneLab experimental facility. OneLab provides you with access to world class computer networking testbeds, such as IoT-LAB, NITOS, and PlanetLab Europe. Our aim at OneLab is to promote the use of these testbeds for pre-commercial research and development by industry, for scientific research, and for university level laboratory exercises.</p>
+<p></p>
+</p>
+Your entry point for access to the testbeds is the OneLab portal, which provides a web-based interface for browsing and reserving resources on the various testbeds. To run an experiment using those resources, you may log in to the testbed and/or individual nodes on the testbed with your OneLab public/private key pair, or use an experiment control tool such as as NEPI or OMF. The OneLab operations team is standing by at support@onelab.eu to provide you with help regarding the portal and to refer your testbed- and tool-specific queries to those best able to answer them.
+</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></p>
+<p>Timur Friedman</p>
+<p>Executive Director</p>
--- /dev/null
+Dear {{first_name}} {{last_name}},
+
+It is my pleasure to welcome you as a fully signed up user of the OneLab experimental facility. OneLab provides you with access to world class computer networking testbeds, such as IoT-LAB, NITOS, and PlanetLab Europe. Our aim at OneLab is to promote the use of these testbeds for pre-commercial research and development by industry, for scientific research, and for university level laboratory exercises.
+
+Your entry point for access to the testbeds is the OneLab portal, which provides a web-based interface for browsing and reserving resources on the various testbeds. To run an experiment using those resources, you may log in to the testbed and/or individual nodes on the testbed with your OneLab public/private key pair, or use an experiment control tool such as as NEPI or OMF. The OneLab operations team is standing by at support@onelab.eu to provide you with help regarding the portal and to refer your testbed- and tool-specific queries to those best able to answer them.
+
+On behalf of the entire team, I wish you a fruitful user experience on OneLab.
+
+Yours sincerely,
+
+Timur Friedman
+Executive Director