From 58f01260ac5b5eff17e2fddf3d1e25377d8ad52e Mon Sep 17 00:00:00 2001 From: Madhusudan.C.S Date: Wed, 21 Jul 2010 17:02:10 +0530 Subject: Removed unwanted mail texts and made the texts scope compliant. --- project/scipycon/registration/utils.py | 185 +++------------------------------ project/scipycon/registration/views.py | 7 +- 2 files changed, 15 insertions(+), 177 deletions(-) diff --git a/project/scipycon/registration/utils.py b/project/scipycon/registration/utils.py index dac9d6f..e7b7409 100644 --- a/project/scipycon/registration/utils.py +++ b/project/scipycon/registration/utils.py @@ -1,190 +1,33 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import - -# django from django.core.mail import EmailMessage -def send_confirmation(registrant, invoice, password=None, sponsor=None, - amount=None): - - message = EmailMessage() - message.subject = u'Registration to SciPy.in 2009' - message.from_email = u'admin@scipy.in' - message.to = [registrant.email] - name = '%s %s' % (registrant.first_name, registrant.last_name) - if name.strip() == '': - name = registrant.username - username = registrant.username - all = {'name': name, - 'password': password, - 'username': username} - - if password: - message.body = confirmation_newuser % all - else: - message.body = confirmation_currentuser % all - - message.send() +def send_confirmation(registrant, event): -def send_confirmation_payment_email(registrant): message = EmailMessage() - message.subject = u'Registration payment to SciPy.in 2009' + message.subject = u'Registration to %s' % (event.get_full_name()) message.from_email = u'admin@scipy.in' message.to = [registrant.email] - name = '%s %s' % (registrant.first_name, registrant.last_name) - username = registrant.username - if name.strip() == '': - name = registrant.username - message.body = confirmation_payment % dict(name=name, - username=username) - message.send() -def send_banking_fix_email(registrant, invoicenum): - message = EmailMessage() - message.subject = u'Registration invoice update to SciPy.in 2009' - message.from_email = u'admin@scipy.in' - message.to = [registrant.email] - name = '%s %s' % (registrant.first_name, registrant.last_name) username = registrant.username - if name.strip() == '': - name = registrant.username - message.body = banking_fix % dict(name=name, - username=username, invoice=invoicenum) - message.send() - -banking_fix = """ -Dear %(name)s, - -Invoice update to Kiwi Pycon 2009. - -Ooops. We made the invoice number too long to be entered for internet banking. -We have therefore changed the prefix and your new invoice number is: -%(invoice)s - -You will find that your online invoice has been updated. Thanks for your -patience. - -http://nz.pycon.org/invoice -A pdf version here: -http://nz.pycon.org/pdf_invoice - -Regards, -The Kiwi Pycon 2009 Team - -Your username, in case you've forgotten: %(username)s. - -If you have lost your password to the website please visit: -http://nz.pycon.org/password-reset - - """ - -confirmation_payment = """ -Dear %(name)s, - -Welcome to Kiwi Pycon 2009. - -Your payment has been received and your attendence confirmed. - -Many thanks! - -You can view your invoice at: -http://nz.pycon.org/invoice -And a pdf version here: -http://nz.pycon.org/pdf_invoice - -Regards, -The Kiwi Pycon 2009 Team - -Your username, in case you've forgotten: %(username)s. - -If you have lost your password to the website please visit: -http://nz.pycon.org/password-reset + all = {'name': registrant.get_full_name(), + 'username': username, + 'event_name': event.get_full_name(), + 'event_scope': event.scope, + } - """ - -confirmation_newuser = """ -Dear %(name)s, - -Welcome to SciPy.in 2009. You may log in to -http://scipy.in/login using the following credentials: - -Username: %(username)s -Password: %(password)s - -There is an entry fee for the SciPy conference only. However -the sprint and tutorials don't have any entry fee. The entry -fee for the conference can be paid on the spot on the first -day of the conference. - -Thanks for your registration! - -Regards, -The SciPy.in Team - -If you lose your password to the website please visit: -http://scipy.in/password-reset - """ - -confirmation_sponsoreduser = """ -Dear %(name)s, - -Welcome to Kiwi Pycon 2009. - -Your username is: %(username)s - -Your registration has been accepted as a guest of %(stype)s -sponsor %(sname)s. - -Thanks! - -Regards, -The Kiwi Pycon 2009 Team - -If you have lost your password to the website please visit: -http://nz.pycon.org/password-reset - - """ - -confirmation_sponsorednewuser = """ -Dear %(name)s, - -Welcome to Kiwi Pycon 2009. - -Your username is: %(username)s -Your password is: %(password)s - -Your registration has been accepted as a guest of %(stype)s sponsor %(sname)s. - -Thanks! - -Regards, -The Kiwi Pycon 2009 Team - -If you lose your password to the website please visit: -http://nz.pycon.org/password-reset - - """ - -confirmation_currentuser = """ -Dear %(name)s, - -Welcome to SciPy.in 2009. You may log in to -http://scipy.in/login using the following credentials: + message.send() -Username: %(username)s -Password: %(password)s +confirmation_newuser = """Dear %(name)s, -There is an entry fee for the SciPy conference only. However -the sprint and tutorials don't have any entry fee. The entry -fee for the conference can be paid on the spot on the first -day of the conference. +Welcome to %(event_name)s. You have registered for %(event_name)s with the +username %(username)s. You may log in to the %(event_name)s website at +http://scipy.in/%(event_scope)s/login using the given username -Thanks for your registration! +Thank you for your registration! Looking forward to meet you at %(event_name)s. Regards, The SciPy.in Team If you lose your password to the website please visit: http://scipy.in/password-reset - """ +""" diff --git a/project/scipycon/registration/views.py b/project/scipycon/registration/views.py index c7d889f..3bc65de 100644 --- a/project/scipycon/registration/views.py +++ b/project/scipycon/registration/views.py @@ -227,12 +227,7 @@ def submit_registration(request, scope, wifi = wifi_form.save(registrant, scope_entity) - # 1. include random password if we are a new user - if passwd: - send_confirmation(registrant, slug, password=passwd) - else: - # 2. send user email with registration id - send_confirmation(registrant, slug) + send_confirmation(registrant, scope_entity) redirect_to = reverse('scipycon_registrations', kwargs={'scope': scope}) -- cgit