sdi/views.py
branchanoop
changeset 53 b226923fbf64
parent 48 a3e6f9470549
child 56 7dfacad8adee
--- 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})