added send_mail after registration anoop
authornishanth
Sun, 06 Jun 2010 01:03:56 +0530
branchanoop
changeset 53 b226923fbf64
parent 52 10840ccc564d
child 54 7515c2d1f5c5
added send_mail after registration
sdi/events.py
sdi/views.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])
+
--- 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})