summaryrefslogtreecommitdiff
path: root/project/scipycon/registration/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'project/scipycon/registration/utils.py')
-rw-r--r--project/scipycon/registration/utils.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/project/scipycon/registration/utils.py b/project/scipycon/registration/utils.py
new file mode 100644
index 0000000..bf4e0cd
--- /dev/null
+++ b/project/scipycon/registration/utils.py
@@ -0,0 +1,38 @@
+from django.core.mail import EmailMessage
+
+
+def send_confirmation(registrant, event ,password=None):
+
+ message = EmailMessage()
+ message.subject = u'Registration to %s' % (event.get_full_name())
+ message.from_email = u'admin@scipy.in'
+ message.to = [registrant.email]
+
+ details = {'name': registrant.get_full_name(),
+ 'username': registrant.username,
+ 'password': password,
+ 'event_name': event.get_full_name(),
+ 'event_scope': event.scope,
+ }
+
+ confirmation_newuser = """Dear %(name)s,
+
+Thank you, for registering for %(event_name)s!
+
+You may log in to the %(event_name)s website at
+http://scipy.in/%(event_scope)s/login using the username -
+%(username)s and the password - %(password)s.
+
+Looking forward to meet you at %(event_name)s.
+
+Regards,
+SciPy.in Team
+
+If you lose your password, visit: http://scipy.in/password-reset
+"""
+
+ message.body = confirmation_newuser %(details)
+
+ message.send()
+
+