?
"""
+
+ authority_hrn = request['authority_hrn']
+ request['authority_hrn'] = authority_hrn.split(".")[0]
+
USER_CONFIG = '{"firstname": "%(first_name)s", "lastname": "%(last_name)s", "authority": "%(authority_hrn)s"}'
user_params = {
'status' : 1,
}
+ request['authority_hrn'] = authority_hrn
+
query = Query.create('local:user').set(user_params).select('email')
results = execute_admin_query(request, query)
if not results:
subject = render_to_string(theme.template, request)
subject = subject.replace('\n', '')
- sender = email
+ theme.template_name = 'email_default_sender.txt'
+ sender = render_to_string(theme.template, request)
+ sender = sender.replace('\n', '')
+
+ #sender = email
msg = EmailMultiAlternatives(subject, text_content, sender, recipients)
msg.attach_alternative(html_content, "text/html")
msg.send()
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)
+ send_mail(subject, msg, 'support@fibre.org.br',[request['email']], fail_silently=False)
return results
def ldap_create_user(wsgi_request, request, user_detail):
try:
# Send an email: the recipients are the PI of the authority
# If No PI is defined for this Authority, send to a default email (different for each theme)
- recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
+
+ split_authority_hrn = request['authority_hrn'].split(".")[0]
+
+ recipients = authority_get_pi_emails(wsgi_request, split_authority_hrn)
theme.template_name = 'user_request_email.html'
html_content = render_to_string(theme.template, request)
--- /dev/null
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
+<br>
+<p>We have received a user signup request for your email address at {{current_site}}</p>
+<p>You have the following user details:</p>
+
+Organization: {{organization}}<br>
+First name: {{first_name}}<br>
+Last name: {{last_name}}<br>
+Email: {{email}}<br>
+
+<p></p>
+<p>
+You may now log in to the portal using your email address and the password that you provided, but your access will be limited. To gain full access, two steps are required:
+</p>
+
+<ul>
+<li>1. You confirm that you have indeed made this request by clicking on the following link: <br>
+ <a href={{validation_link}}>{{validation_link}}</a>
+ <ul><li>If you did not make this request, we apologise. You may disregard this email or you may advise us the error by replying to this email.</li></ul>
+</li>
+<li>
+2. A manager from your organization validates your request. Upon confirmation of your signup request, we will send an email to the managers at your organization with a validation request.
+</li>
+</ul>
+<p>
+We look forward to welcoming you to Myslice. You will find answers to frequently asked questions <a href="https://{{current_site}}/portal/support/">here</a>.
+Please don't hesitate to <a href="https://{{current_site}}/portal/contact/">contact us</a> with any additional questions that you might have.
+</p>
--- /dev/null
+We have received a user signup request for your email address at {{current_site}}
+
+You have the following user details:
+
+Organization: {{organization}}
+First name: {{first_name}}
+Last name: {{last_name}}
+Email: {{email}}
+
+You may now log in to the portal using your email address and the password that you provided, but your access will be limited. To gain full access, two steps are required:
+
+ 1. You confirm that you have indeed made this request by clicking on the following link:
+
+ {{validation_link}}
+
+ If you did not make this request, we apologise. You may disregard this email or you may advise us the error by replying to this email.
+
+ 2. A manager from your organization validates your request. Upon confirmation of your signup request, we will send an email to the managers at your organization with a validation request.
+
+We look forward to welcoming you to Myslice.
+Please don't hesitate to contact us at support@fibre.org.br with any additional questions that you might have.
+
+
+
--- /dev/null
+{{current_site}} Portal user email activation
--- /dev/null
+support@fibre.org.br
{% if authority.name %}
{value:"{{ authority.name }}",label:"{{authority.name}}"},
{% else %}
- {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
+ {% if authority.authority_hrn == "fibre.ufrj" %}
+ {value:"{{ authority.authority_hrn }}",label:"UNIVERSIDADE FEDERAL DO RIO DE JANEIRO"},
+ {% else %}
+ {value:"{{ authority.authority_hrn }}",label:"FIBRE"},
+ {% endif %}
{% endif %}
{% endfor %}
{% else %}
--- /dev/null
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
+<br>
+<h1>NEW SLICE REQUEST</h1>
+<br>
+<b>Slice name :</b> {{slice_name}}</br>
+<b>URL :</b> {{exp_url}}</br>
+<b>Purpose :</b> {{purpose}}</br>
+<b>Organization :</b> {{organization}}</br>
+<b>Email :</b> {{email}}</br>
+<b>Portal url :</b> {{current_site}}</br>
+
--- /dev/null
+NEW SLICE REQUEST
+
+Slice name : {{slice_name}}
+URL : {{exp_url}}
+Purpose : {{purpose}}
+Email : {{email}}
+Organization : {{organization}}
+Portal url : {{current_site}}
+
--- /dev/null
+Slice request submitted
-<img src="https://onelab.eu/templates/onelab2/images/logo.png">
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
<br>
<h1>NEW USER REQUEST</h1>
<br>
-<p>You are receiving this request because we have you listed as a manager at an organization that uses OneLab.</p>
-<p>If you believe that you have received this message in error, or if you have any questions, kindly contact support@onelab.eu.</p>
+<p>You are receiving this request because we have you listed as a manager at an organization that uses Myslice portal.</p>
+<p>If you believe that you have received this message in error, or if you have any questions, kindly contact support@fibre.org.br.</p>
<br>
<b>First name :</b> {{first_name}}<br>
<b>Last name :</b> {{last_name}}<br>
<b>User hrn :</b> {{user_hrn}}<br>
<b>Portal url :</b> {{ current_site }}<br>
<p></p>
-<p>You can validate the user <a href="http://{{current_site}}/portal/validate">here</a>.<p>
-<p>Please note that the validation request will only become visible to you on the OneLab portal once the user has confirmed his/her email address.</p>
+<p>You can validate the user <a href="https://{{current_site}}/portal/validate">here</a>.<p>
+<p>Please note that the validation request will only become visible to you on the Myslice portal once the user has confirmed his/her email address.</p>
NEW USER REQUEST
-You are receiving this request because we have you listed as a manager at an organization that uses OneLab.
-If you believe that you have received this message in error, or if you have any questions, kindly contact support@onelab.eu.
+You are receiving this request because we have you listed as a manager at an organization that uses Myslice portal.
+If you believe that you have received this message in error, or if you have any questions, kindly contact support@fibre.org.br.
First name : {{first_name}}
Last name : {{last_name}}
User hrn : {{user_hrn}}
Portal url : {{ current_site }}
-You can validate the user here: http://{{current_site}}/portal/validate
+You can validate the user here: https://{{current_site}}/portal/validate
-Please note that the validation request will only become visible to you on the OneLab portal once the user has confirmed his/her email address.
+Please note that the validation request will only become visible to you on the Myslice portal once the user has confirmed his/her email address.
--- /dev/null
+User request submitted