# HG changeset patch # User nishanth # Date 1275766436 -19800 # Node ID b226923fbf64254d18dec0c8ead3c2f93ddcab78 # Parent 10840ccc564d447e684f4496895bb8b7bc2534ff added send_mail after registration diff -r 10840ccc564d -r b226923fbf64 sdi/events.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sdi/events.py Sun Jun 06 01:03:56 2010 +0530 @@ -0,0 +1,31 @@ +from django.core.mail import send_mail + +def send_reg_complete_mail(email, fist_name, last_name): + """ send registration complete email to the registered user. + """ + + subject = "Sage Days India 25 - Registration" + + message = """ + Dear %s %s, + + Thank you for registering on Sage Days 25, India. Since we have limited number of seats we will be mailing you the status of your registration shortly. + Meanwhile you may join the Sage Days mailing list/group at [http://groups.google.com/group/sagedays25]. + + Registration Fee: + There is a registration fee of Rs.200/- and it can be paid on reporting at the conference. + + Accommodation: + The accommodation for delegates is limited and hence you shall be notified on the status of your accommodation(if required) soon. + + Queries: + Feel free to contact us at sagedays@fossee.in for any queries. + + Thanking you, + + Sage Days India Team, + FOSSEE, IIT Bombay. + """%(first_name.title(), last_name.title()) + + send_mail(subject, message, "sagedays@fossee.in", [email]) + diff -r 10840ccc564d -r b226923fbf64 sdi/views.py --- a/sdi/views.py Sat Jun 05 21:05:23 2010 +0530 +++ b/sdi/views.py Sun Jun 06 01:03:56 2010 +0530 @@ -4,6 +4,7 @@ from sage_days.sdi.models import Registrant from sage_days.sdi.forms import RegisterForm, SearchForm +from sage_days.sdi.events import send_reg_complete_mail def register(request): """ The user register page. @@ -13,6 +14,13 @@ form = RegisterForm(request.POST) if form.is_valid(): form.save() + + data = form.cleaned_data + first_name = data['first_name'] + last_name = data['last_name'] + email = data['email'] + send_reg_complete_mail(email, first_name, last_name) + return redirect("/sage_days/registration/complete") else: return render_to_response("register.html", {"form":form})