scripts/mails.py
changeset 44 c390adb66ba6
parent 42 efacdf0cd268
child 45 a7cb2566be42
equal deleted inserted replaced
43:cb1a447c48f4 44:c390adb66ba6
    28             template, dictionary={'name': talk.speaker.username,
    28             template, dictionary={'name': talk.speaker.username,
    29                                   'title': talk.title})
    29                                   'title': talk.title})
    30 
    30 
    31         talk.speaker.email_user(subject=subject, message=message,
    31         talk.speaker.email_user(subject=subject, message=message,
    32                                 from_email='admin@scipy.in')
    32                                 from_email='admin@scipy.in')
       
    33 
       
    34 def speaker_sponsorship():
       
    35     """Sends a mail to each speaker whose talk has been accepted
       
    36     informing them about the their sponsorship.
       
    37     """
       
    38 
       
    39     talks = Talk.objects.all()
       
    40 
       
    41     template = 'notifications/speaker_sponsorship_mail.html'
       
    42 
       
    43     for talk in talks:
       
    44         subject = 'Details regarding your travel and accommodation for SciPy.in 2009'
       
    45         message = loader.render_to_string(
       
    46             template, dictionary={'name': talk.speaker.username,
       
    47                                   'title': talk.title})
       
    48 
       
    49         talk.speaker.email_user(subject=subject, message=message,
       
    50                                 from_email='admin@scipy.in')