scripts/mails.py
branchpayments
changeset 278 2ea8af6851c9
parent 96 178b89a3ca4f
child 284 291f4bb93888
equal deleted inserted replaced
277:b203f1792ed2 278:2ea8af6851c9
    51 
    51 
    52         talk.speaker.email_user(subject=subject, message=message,
    52         talk.speaker.email_user(subject=subject, message=message,
    53                                 from_email='admin@scipy.in')
    53                                 from_email='admin@scipy.in')
    54 
    54 
    55 
    55 
    56 def delegate_remainder():
    56 def delegate_remainder(template=None):
    57     """Sends a mail to each speaker whose talk has been accepted
    57     """Sends a mail to each delegate about the template content specified.
    58     informing them about the their sponsorship.
       
    59     """
    58     """
    60 
    59 
    61     regs = User.objects.all()
    60     regs = Registration.objects.all()
    62 
       
    63     template = 'notifications/reminder_mail.html'
       
    64 
    61 
    65     for reg in regs:
    62     for reg in regs:
    66         subject = 'SciPy.in 2009: Remainder and details'
    63         subject = 'SciPy.in 2010: Registration updates required for confirmation'
    67         message = loader.render_to_string(
    64         message = loader.render_to_string(
    68             template, dictionary={'name': reg.username})
    65             template, dictionary={'name': reg.registrant.get_full_name()})
    69 
    66 
    70         reg.email_user(subject=subject, message=message,
    67         reg.registrant.email_user(subject=subject, message=message,
    71                        from_email='madhusudancs@gmail.com')
    68                                   from_email='info@scipy.in')
    72 
    69 
    73 
    70 
    74 def delegate_about_event():
    71 def delegate_about_event():
    75     """Sends a mail to each confirmed delegate informing
    72     """Sends a mail to each confirmed delegate informing
    76     them about the the individual events.
    73     them about the the individual events.