scripts/mails.py
changeset 44 c390adb66ba6
parent 42 efacdf0cd268
child 45 a7cb2566be42
--- a/scripts/mails.py	Thu Dec 03 01:45:17 2009 +0530
+++ b/scripts/mails.py	Sat Dec 05 09:39:02 2009 +0530
@@ -30,3 +30,21 @@
 
         talk.speaker.email_user(subject=subject, message=message,
                                 from_email='admin@scipy.in')
+
+def speaker_sponsorship():
+    """Sends a mail to each speaker whose talk has been accepted
+    informing them about the their sponsorship.
+    """
+
+    talks = Talk.objects.all()
+
+    template = 'notifications/speaker_sponsorship_mail.html'
+
+    for talk in talks:
+        subject = 'Details regarding your travel and accommodation for SciPy.in 2009'
+        message = loader.render_to_string(
+            template, dictionary={'name': talk.speaker.username,
+                                  'title': talk.title})
+
+        talk.speaker.email_user(subject=subject, message=message,
+                                from_email='admin@scipy.in')
\ No newline at end of file