From 60e8b9b6c8a7f1907fb6cb928ff3b8366285d553 Mon Sep 17 00:00:00 2001 From: Madhusudan.C.S Date: Thu, 3 Dec 2009 01:44:56 +0530 Subject: Added template which sends the accepted speakes a mail. --- scripts/mails.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/mails.py (limited to 'scripts') diff --git a/scripts/mails.py b/scripts/mails.py new file mode 100644 index 0000000..460ee98 --- /dev/null +++ b/scripts/mails.py @@ -0,0 +1,32 @@ +"""Helper script to send emails to the users to remind of the +registration and inform them to complete their profiles and stuff. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +from django.template import loader + +from project.kiwipycon.talk.models import Talk + + +def speaker_accepted(): + """Sends a mail to each speaker whose talk has been accepted + informing them about the same. + """ + + talks = Talk.objects.all() + + template = 'notifications/speaker_accepted_mail.html' + + for talk in talks: + subject = 'Your talk has been selected 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') -- cgit