def user_activation_notify(user):
current_site = Site.objects.get_current()
+ peer = user.get_profile().peer
+
+
+ # Email subject *must not* contain newlines
+ # TechCs will be notified about new users.
+ # Platform admins will activate the users.
subject = render_to_string('registration/activation_email_subject.txt',
{ 'site': current_site })
- # Email subject *must not* contain newlines
subject = ''.join(subject.splitlines())
registration_profile = RegistrationProfile.objects.create_profile(user)
message = render_to_string('registration/activation_email.txt',
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
'site': current_site,
'user': user })
+ if settings.NOTIFY_ADMIN_MAILS:
+ admin_mails = settings.NOTIFY_ADMIN_MAILS
+ send_new_mail(settings.EMAIL_SUBJECT_PREFIX + subject,
+ message, settings.SERVER_EMAIL,
+ admin_mails, [])
+
+ # Mail to domain techCs plus platform admins (no activation hash sent)
+ subject = render_to_string('registration/activation_email_peer_notify_subject.txt',
+ { 'site': current_site,
+ 'peer': peer })
+ subject = ''.join(subject.splitlines())
+ message = render_to_string('registration/activation_email_peer_notify.txt',
+ { 'user': user,
+ 'peer': peer })
send_new_mail(settings.EMAIL_SUBJECT_PREFIX + subject,
message, settings.SERVER_EMAIL,
get_peer_techc_mails(user), [])
techmails_list.append(techmail.email)
if settings.NOTIFY_ADMIN_MAILS:
additional_mail = settings.NOTIFY_ADMIN_MAILS
-# mail.extend(user_mail)
mail.extend(additional_mail)
mail.extend(techmails_list)
return mail
--- /dev/null
+Ο/H {{ user.get_full_name }} έκανε αίτηση για νεό λογαριασμό στην υπηρεσία Firewall On Demand
+εκ μέρους του ιδρύματος/φορέα: {{peer}}.
+
+Όνομα χρήστη: {{ user.username }}
+E-mail: {{ user.email }}
+
+Ο χρήστης θα ενημερωθεί για την ενεργοποίηση του λογαριασμού του μέσω e-mail.
+
+Σε περίπτωση που ο χρήστης δεν ανήκει στο ίδρυμα/φορέα σας ή χρησιμοποιεί την υπηρεσία ενάντια στον
+εσωτερικό σας κανονισμό παρακαλούμε επικοινωνήστε άμεσα μαζί μας.
+
+-----------------------------------------------------------------------------
+
+{{ user.get_full_name }} has registered for a new Firewall on Demand account on behalf of your
+institution: {{peer}}.
+
+Username: {{user.username}}
+E-mail: {{user.email}}
+
+The user will be notified via mail about the account activation
+
+In case this user does not belong to your institution or attempts to use the service without being
+compliant to your instututions' regulation please contact us.