created the mail event and added it in view for send_wsp_ptc anoop
authornishanhth
Thu, 22 Jul 2010 22:37:43 +0530
branchanoop
changeset 162 27dd4494e7b4
parent 161 c7c5c727a483
child 163 b23792dfea3d
created the mail event and added it in view for send_wsp_ptc
sdi/events.py
sdi/views.py
--- a/sdi/events.py	Thu Jul 22 19:50:36 2010 +0530
+++ b/sdi/events.py	Thu Jul 22 22:37:43 2010 +0530
@@ -31,6 +31,31 @@
 
     send_mail(subject, message, "sagedays@fossee.in", [email])
 
+def send_wsp_ptc_confirm(user)
+    """ send a mail telling a worksho has been scheduled.
+    """
+
+    subject = "Sage Days 25, India - Python Workshop"
+
+    message = """
+Dear %s %s,
+
+We are conducting a one day workshop on Python on Jul 31st for people who requested a workshop before Sage Days 25.
+
+Please click the link below or paste it in a browser to confirm your participation.
+http://fossee.in/sage_days/registration/cnf_wsp_ptc/%s?email=%s
+
+Please ignore this mail if you are not likely to attend the workshop.
+
+Thanking you,
+
+Sage Days India Team,
+FOSSEE, IIT Bombay.
+    """%(user.first_name.title(), user.last_name.title(), user.id, user.email)
+
+    send_mail(subject, message, "sagedays@fossee.in", [user.email])
+
+
 def send_sgd_ptc_confirm(user):
     """ send a mail telling that you have been selected to attend sage days.
     """
--- a/sdi/views.py	Thu Jul 22 19:50:36 2010 +0530
+++ b/sdi/views.py	Thu Jul 22 22:37:43 2010 +0530
@@ -7,7 +7,7 @@
 
 from sage_days.sdi.models import Registrant, RegistrantInfo, ParticipantInfo
 from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm, ParticipantInfoForm
-from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_sgd_ptc_confirm, send_cnf_email
+from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_sgd_ptc_confirm, send_cnf_email, send_wsp_ptc_confirm
 from sage_days.settings import APACHE_URL_PREFIX as aup
 
 def register(request):
@@ -134,6 +134,8 @@
             user_info.status_of_attending_workshop = "2"
             user_info.save()
 
+        send_wsp_ptc_confirm(user)
+
         return render_to_response("sent_wsp_confirm.html", {"selected_users":selected_users})
     else:
         return render_to_response("send_wsp_cnf.html", {"attending": attending_ppl,