included the send_mail and created the corresponding event in events anoop
authornishanth
Sat, 17 Jul 2010 00:26:16 +0530
branchanoop
changeset 118 6c3602582f9f
parent 117 af9472ab8f3e
child 119 eecbb1e59a3a
child 120 f9408ab30ace
included the send_mail and created the corresponding event in events
sdi/events.py
sdi/views.py
templates/send_sgd_cnf.html
--- a/sdi/events.py	Sat Jul 17 00:08:33 2010 +0530
+++ b/sdi/events.py	Sat Jul 17 00:26:16 2010 +0530
@@ -4,7 +4,7 @@
     """ send registration complete email to the registered user.
     """
 
-    subject = "Sage Days India 25 - Registration"
+    subject = "Sage Days 25, India - Registration"
 
     message = """
 Dear %s %s,
@@ -31,6 +31,34 @@
 
     send_mail(subject, message, "sagedays@fossee.in", [email])
 
+def send_wsp_ptc_confirm(user):
+    """ send a mail telling that you have been selected to attend sage days.
+    """
+
+    subject = "Sage Days 25, India - Selected for participation"
+
+    message = """
+Dear %s %s,
+
+You have been selected to attend Sage Days 25, India.
+
+Please click the link below or paste it in a browser to confirm your participation.
+http://fossee.in/sage_days/registration/cnf_sgd_ptc/%s?email=%s
+
+Please ignore this mail if you are not likely to attend Sage Days 25, India.
+
+PS:
+Your participation will be confirmed only if you visit the link above at the latest by 26 July, 2010.
+If you by any chance have not confirmed your participation by 26 July,  2010 and still want to participate, write a mail to sagedays@fossee.in
+
+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", [email])
+
 def mail_invi(to_emails):
     """ send the invitation email to given email addresses.
     """
--- a/sdi/views.py	Sat Jul 17 00:08:33 2010 +0530
+++ b/sdi/views.py	Sat Jul 17 00:26:16 2010 +0530
@@ -7,7 +7,7 @@
 
 from sage_days.sdi.models import Registrant
 from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm
-from sage_days.sdi.events import send_reg_complete_mail, mail_invi
+from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_wsp_ptc_confirm
 from sage_days.settings import APACHE_URL_PREFIX as aup
 
 def register(request):
@@ -143,6 +143,8 @@
             user_info = user.registrantinfo_set.all()[0]
             user_info.status_of_attending_sagedays = "2"
             user_info.save()
+
+            send_wsp_ptc_confirm(user)
         
         return render_to_response("sent_sgd_confirm.html", {"selected_users":selected_users})
     else:
--- a/templates/send_sgd_cnf.html	Sat Jul 17 00:08:33 2010 +0530
+++ b/templates/send_sgd_cnf.html	Sat Jul 17 00:26:16 2010 +0530
@@ -30,7 +30,7 @@
 {% endfor %}
 </table>
 
-<input type=submit value=send />
+<input type=submit value="Send confirmation email"  />
 </form>
 
 Attending Ppl: <br />