author | primal primal007@gmail.com |
Sun, 11 Sep 2011 16:34:54 +0530 | |
branch | 2011 |
changeset 389 | fe49720e67bf |
parent 359 | 9640495f5097 |
permissions | -rw-r--r-- |
42
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
"""Helper script to send emails to the users to remind of the |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
2 |
registration and inform them to complete their profiles and stuff. |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
3 |
""" |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
4 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
5 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
__authors__ = [ |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
7 |
'"Madhusudan.C.S" <madhusudancs@gmail.com>', |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
8 |
] |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
9 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
10 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
11 |
from django.template import loader |
48
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
12 |
from django.contrib.auth.models import User |
359
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
13 |
from django.utils.translation import ugettext |
42
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
14 |
|
96
178b89a3ca4f
Removed unwanted files and made more changes to make SciPyCon a clean app.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
82
diff
changeset
|
15 |
from project.scipycon.registration.models import Registration |
178b89a3ca4f
Removed unwanted files and made more changes to make SciPyCon a clean app.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
82
diff
changeset
|
16 |
from project.scipycon.talk.models import Talk |
42
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
17 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
18 |
|
359
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
19 |
DEF_REMAINDER_REGISTRATION_PAGE_SUBJECT = ugettext( |
389 | 20 |
'SciPy.in 2011: Registration updates required for confirmation') |
359
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
21 |
|
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
22 |
DEF_REMAINDER_ACCO_CONTACT_SUBJECT = ugettext( |
389 | 23 |
'SciPy.in 2011: Contact details, registration page and other updates') |
359
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
24 |
|
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
25 |
|
42
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
26 |
def speaker_accepted(): |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
27 |
"""Sends a mail to each speaker whose talk has been accepted |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
28 |
informing them about the same. |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
29 |
""" |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
30 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
31 |
talks = Talk.objects.all() |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
32 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
33 |
template = 'notifications/speaker_accepted_mail.html' |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
34 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
35 |
for talk in talks: |
389 | 36 |
subject = 'Your talk has been selected for SciPy.in 2011!' |
42
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
37 |
message = loader.render_to_string( |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
38 |
template, dictionary={'name': talk.speaker.username, |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
39 |
'title': talk.title}) |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
40 |
|
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
41 |
talk.speaker.email_user(subject=subject, message=message, |
efacdf0cd268
Added template which sends the accepted speakes a mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
42 |
from_email='admin@scipy.in') |
44
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
43 |
|
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
44 |
|
44
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
45 |
def speaker_sponsorship(): |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
46 |
"""Sends a mail to each speaker whose talk has been accepted |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
47 |
informing them about the their sponsorship. |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
48 |
""" |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
49 |
|
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
50 |
talks = Talk.objects.all() |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
51 |
|
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
52 |
template = 'notifications/speaker_sponsorship_mail.html' |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
53 |
|
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
54 |
for talk in talks: |
389 | 55 |
subject = 'Details regarding your travel and accommodation for SciPy.in 2011' |
44
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
56 |
message = loader.render_to_string( |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
57 |
template, dictionary={'name': talk.speaker.username, |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
58 |
'title': talk.title}) |
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
59 |
|
c390adb66ba6
Sponsorship for speakers mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
42
diff
changeset
|
60 |
talk.speaker.email_user(subject=subject, message=message, |
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
61 |
from_email='admin@scipy.in') |
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
62 |
|
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
63 |
|
278
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
64 |
def delegate_remainder(template=None): |
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
65 |
"""Sends a mail to each delegate about the template content specified. |
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
66 |
""" |
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
67 |
|
278
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
68 |
regs = Registration.objects.all() |
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
69 |
|
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
70 |
for reg in regs: |
359
9640495f5097
Email to be sent to participants about contact details and registration updates just before finals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
284
diff
changeset
|
71 |
subject = DEF_REMAINDER_ACCO_CONTACT_SUBJECT |
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
72 |
message = loader.render_to_string( |
278
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
73 |
template, dictionary={'name': reg.registrant.get_full_name()}) |
45
a7cb2566be42
Delegate remainder mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
44
diff
changeset
|
74 |
|
278
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
75 |
reg.registrant.email_user(subject=subject, message=message, |
2ea8af6851c9
Modify the delegate_remainder function to send mails for the registered user and add content for registration update mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
96
diff
changeset
|
76 |
from_email='info@scipy.in') |
48
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
77 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
78 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
79 |
def delegate_about_event(): |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
80 |
"""Sends a mail to each confirmed delegate informing |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
81 |
them about the the individual events. |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
82 |
""" |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
83 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
84 |
regs = Registration.objects.all() |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
85 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
86 |
template = 'notifications/sprints_about_mail.html' |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
87 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
88 |
for reg in regs: |
389 | 89 |
subject = 'SciPy.in 2011: Details of the individual events' |
48
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
90 |
message = loader.render_to_string( |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
91 |
template, dictionary={'name': reg.registrant.username}) |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
92 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
93 |
reg.registrant.email_user(subject=subject, message=message, |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
94 |
from_email='madhusudancs@gmail.com') |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
95 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
96 |
|
61
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
97 |
def delegate_last_day(): |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
98 |
"""Sends a mail to each confirmed delegate informing |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
99 |
them about the final details. |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
100 |
""" |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
101 |
|
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
102 |
regs = Registration.objects.all() |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
103 |
|
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
104 |
template = 'notifications/last_day_mail.html' |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
105 |
|
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
106 |
for reg in regs: |
389 | 107 |
subject = 'SciPy.in 2011: Schedule and other details' |
61
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
108 |
message = loader.render_to_string( |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
109 |
template, dictionary={'name': reg.registrant.username}) |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
110 |
|
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
111 |
reg.registrant.email_user(subject=subject, message=message, |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
112 |
from_email='madhusudancs@gmail.com') |
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
113 |
|
959ec5eaafb1
Added last day mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
48
diff
changeset
|
114 |
|
48
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
115 |
def speaker_confirmation(): |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
116 |
"""Sends a mail to each speaker asking for confirmation. |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
117 |
""" |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
118 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
119 |
talks = Talk.objects.all() |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
120 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
121 |
template = 'notifications/speaker_confirmation_mail.html' |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
122 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
123 |
for talk in talks: |
389 | 124 |
subject = 'SciPy.in 2011: Requesting for confirmation of your talk' |
48
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
125 |
message = loader.render_to_string( |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
126 |
template, dictionary={'name': talk.speaker.username, |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
127 |
'title': talk.title}) |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
128 |
|
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
129 |
talk.speaker.email_user(subject=subject, message=message, |
bb835205604b
Summary of individual events mail to all users.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
47
diff
changeset
|
130 |
from_email='admin@scipy.in') |
82
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
131 |
|
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
132 |
def proceedings_detail(): |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
133 |
"""Sends a mail to each speaker informing them about proceedings |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
134 |
""" |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
135 |
|
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
136 |
talks = Talk.objects.all() |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
137 |
|
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
138 |
template = 'notifications/proceedings_detail_mail.html' |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
139 |
|
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
140 |
for talk in talks: |
389 | 141 |
subject = 'SciPy.in 2011 Proceedings' |
82
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
142 |
message = loader.render_to_string( |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
143 |
template, dictionary={'name': talk.speaker.username}) |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
144 |
|
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
145 |
talk.speaker.email_user(subject=subject, message=message, |
a123369b0901
Proceedings details mail.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
61
diff
changeset
|
146 |
from_email='admin@scipy.in') |