sdi/events.py
branchanoop
changeset 212 5c71757e7e0e
parent 211 a098e677b5a0
child 246 3a32df4b3171
--- a/sdi/events.py	Thu Aug 05 00:14:17 2010 +0530
+++ b/sdi/events.py	Fri Aug 06 14:22:10 2010 +0530
@@ -141,24 +141,83 @@
 
     send_mail(subject, message, "sagedays@fossee.in", [user.email])
 
-def send_acco_confirm_mail(user_obj, message):
+def send_acco_confirm_mail(user_obj, venue, amount, bedding=False):
     """ take the given message and add it to main message and send the mail.
     """
 
-    subject = "Sage Days 25, India - Accomodation arranged"
+    subject = "[Sage Days 25, India] Accommodation details"
+
+    if bedding:
+        bedding_content = 'Also it will be helpful for you to carry some '\
+            'kind of light bedding although a single mat is likely to be '\
+            'provided. '
+    else:
+        bedding_content = ''
+
+    main_message = """
+Dear %(first_name)s %(last_name)s,
 
-    main_message="""
-Dear %s %s,
+  We are pleased to inform that you have been allotted accommodation
+during Sage Days 25, as per your request at the time of registration.
+Please note that the accommodation availability in IITB is very limited
+for residing students and staff themselves and hence we have alloted all
+the rooms on twin shared basis for the participants of Sage Days 25. Also
+there is a charge involved with the accommodation which is mentioned
+below. Kindly oblige. When you arrive at IIT Bombay please feel free to
+call Madhusudan.C.S on +91-9987214220 for further details on getting to
+the place of accommodation. If Madhusudan is not reachable, as a fall back
+please feel free to contact Anoop on +91-8149769093. %(bedding)sPlease
+carry your valid Identity card. Also please confirm the requirement of
+accommodation as per these conditions by Saturday, Aug 7th, 2010 evening.
+If we receive no response from you by 7th evening we will your allot the
+accommodation to other participants who are wait-listed now.
 
-Your request for accomodation during Sage Days 25, India has been accepted.
+Your accommodation venue: %(venue)s
+Charge: Rs. %(amount)s per day
 
-%s
+Please note that you need to deposit the money for all the four days at
+the time of obtaining the accommodation. If you are leaving early we will
+reimburse the remaining amount.
 
 Thanking you,
 
 Sage Days India Team,
-FOSSEE, IIT Bombay.
-    """%(user_obj.first_name.title(), user_obj.last_name.title(),message)
+FOSSEE, IIT Bombay.""" % {
+           'first_name': user_obj.first_name.title(),
+           'last_name': user_obj.last_name.title(),
+           'venue': venue,
+           'amount': amount,
+           'bedding': bedding_content,
+           }
+
+    send_mail(subject, main_message, "sagedays@fossee.in", [user_obj.email])
+
+def send_acco_reject_mail(user_obj):
+    """ Send the accommodation reject mail.
+    """
+
+    subject = "[Sage Days 25, India] Accommodation details"
+
+    main_message = """
+Dear %(first_name)s %(last_name)s,
+
+  We regret to inform you that we haven't been able to allot accommodation
+to you because of a lot of demand and the facilities in IIT Bombay is
+extremely limited. Although we haven't completely rejected your request.
+You have been wait-listed for accommodation and if participants who have
+been alloted accommodation don't confirm by 7th August, 2010 evening we
+will allot them to the wait-listed participants. Although please note, if
+alloted accommodation, there will be charges associated with
+accommodation, the details of which will be sent if you have been given
+accommodation.
+
+Thanking you,
+
+Sage Days India Team,
+FOSSEE, IIT Bombay.""" % {
+           'first_name': user_obj.first_name.title(),
+           'last_name': user_obj.last_name.title()
+           }
 
     send_mail(subject, main_message, "sagedays@fossee.in", [user_obj.email])