1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
"""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" <madhusudancs@gmail.com>',
]
from django.template import loader
from django.contrib.auth.models import User
from project.kiwipycon.registration.models import Registration
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')
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')
def delegate_remainder():
"""Sends a mail to each speaker whose talk has been accepted
informing them about the their sponsorship.
"""
regs = User.objects.all()
template = 'notifications/reminder_mail.html'
for reg in regs:
subject = 'SciPy.in 2009: Remainder and details'
message = loader.render_to_string(
template, dictionary={'name': reg.username})
reg.email_user(subject=subject, message=message,
from_email='madhusudancs@gmail.com')
def delegate_about_event():
"""Sends a mail to each confirmed delegate informing
them about the the individual events.
"""
regs = Registration.objects.all()
template = 'notifications/sprints_about_mail.html'
for reg in regs:
subject = 'SciPy.in 2009: Details of the individual events'
message = loader.render_to_string(
template, dictionary={'name': reg.registrant.username})
reg.registrant.email_user(subject=subject, message=message,
from_email='madhusudancs@gmail.com')
def delegate_last_day():
"""Sends a mail to each confirmed delegate informing
them about the final details.
"""
regs = Registration.objects.all()
template = 'notifications/last_day_mail.html'
for reg in regs:
subject = 'SciPy.in 2009: Schedule and other details'
message = loader.render_to_string(
template, dictionary={'name': reg.registrant.username})
reg.registrant.email_user(subject=subject, message=message,
from_email='madhusudancs@gmail.com')
def speaker_confirmation():
"""Sends a mail to each speaker asking for confirmation.
"""
talks = Talk.objects.all()
template = 'notifications/speaker_confirmation_mail.html'
for talk in talks:
subject = 'SciPy.in 2009: Requesting for confirmation of your talk'
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')
|