summaryrefslogtreecommitdiff
path: root/project/kiwipycon/registration/utils.py
blob: 58fe5f346604c47d59e3b2c41e4dfdf92be5832d (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# -*- coding: utf-8 -*-
from __future__ import absolute_import

# django
from django.core.mail import EmailMessage

def send_confirmation(registrant, invoice, password=None, sponsor=None,
        amount=None):

    message = EmailMessage()
    message.subject = u'Registration to SciPy.in 2009'
    message.from_email = u'admin@scipy.in'
    message.to = [registrant.email]
    name = '%s %s' % (registrant.first_name, registrant.last_name)
    if name.strip() == '':
        name = registrant.username

    username = registrant.username
    all = {'name': name,
            'password': password,
            'username': username}

    if password:
        message.body = confirmation_newuser % all
    else:
        message.body = confirmation_currentuser % all

    message.send()

def send_confirmation_payment_email(registrant):
    message = EmailMessage()
    message.subject = u'Registration payment to SciPy.in 2009'
    message.from_email = u'admin@scipy.in'
    message.to = [registrant.email]
    name = '%s %s' % (registrant.first_name, registrant.last_name)
    username = registrant.username
    if name.strip() == '':
        name = registrant.username
    message.body = confirmation_payment % dict(name=name,
            username=username)
    message.send()

def send_banking_fix_email(registrant, invoicenum):
    message = EmailMessage()
    message.subject = u'Registration invoice update to SciPy.in 2009'
    message.from_email = u'admin@scipy.in'
    message.to = [registrant.email]
    name = '%s %s' % (registrant.first_name, registrant.last_name)
    username = registrant.username
    if name.strip() == '':
        name = registrant.username
    message.body = banking_fix % dict(name=name,
            username=username, invoice=invoicenum)
    message.send()

banking_fix = """
Dear %(name)s,

Invoice update to Kiwi Pycon 2009.

Ooops. We made the invoice number too long to be entered for internet banking.
We have therefore changed the prefix and your new invoice number is:
%(invoice)s

You will find that your online invoice has been updated. Thanks for your
patience.

http://nz.pycon.org/invoice
A pdf version here:
http://nz.pycon.org/pdf_invoice

Regards,
The Kiwi Pycon 2009 Team

Your username, in case you've forgotten: %(username)s.

If you have lost your password to the website please visit:
http://nz.pycon.org/password-reset

    """

confirmation_payment = """
Dear %(name)s,

Welcome to Kiwi Pycon 2009.

Your payment has been received and your attendence confirmed.

Many thanks!

You can view your invoice at:
http://nz.pycon.org/invoice
And a pdf version here:
http://nz.pycon.org/pdf_invoice

Regards,
The Kiwi Pycon 2009 Team

Your username, in case you've forgotten: %(username)s.

If you have lost your password to the website please visit:
http://nz.pycon.org/password-reset

    """

confirmation_newuser = """
Dear %(name)s,

Welcome to Kiwi Pycon 2009. You may log in to 
http://nz.pycon.org/login using the following credentials:

Username: %(username)s
Password: %(password)s

Amount: %(amount)s

Your invoice number is: %(invoice)s

Please use this number and your username as reference when 
making payment to the following:

New Zealand Python User Group,
06-0158-0360348-00
The National Bank,
Auckland University Branch
PO Box 2132

Thanks for your registration!

You can view your invoice at:
http://nz.pycon.org/invoice
And a pdf version here:
http://nz.pycon.org/pdf_invoice

Regards,
The Kiwi Pycon 2009 Team

If you lose your password to the website please visit:
http://nz.pycon.org/password-reset

    """

confirmation_sponsoreduser = """
Dear %(name)s,

Welcome to Kiwi Pycon 2009.

Your username is: %(username)s

Your registration has been accepted as a guest of %(stype)s 
sponsor %(sname)s.

Thanks!

Regards,
The Kiwi Pycon 2009 Team

If you have lost your password to the website please visit:
http://nz.pycon.org/password-reset

    """

confirmation_sponsorednewuser = """
Dear %(name)s,

Welcome to Kiwi Pycon 2009.

Your username is: %(username)s
Your password is: %(password)s

Your registration has been accepted as a guest of %(stype)s sponsor %(sname)s.

Thanks!

Regards,
The Kiwi Pycon 2009 Team

If you lose your password to the website please visit:
http://nz.pycon.org/password-reset

    """

confirmation_currentuser = """
Dear %(name)s,

Welcome to Kiwi Pycon 2009.

Your invoice number is: %(invoice)s
Your username is: %(username)s

Amount: %(amount)s

Please use this number and your username as reference when making payment
to the following:

New Zealand Python User Group,
06-0158-0360348-00
The National Bank,
Auckland University Branch
PO Box 2132

Thanks for your registration!

You can view your invoice at:
http://nz.pycon.org/invoice 
And a pdf version here:
http://nz.pycon.org/pdf_invoice

Regards,
The Kiwi Pycon 2009 Team

If you have lost your password to the website please visit:
http://nz.pycon.org/password-reset

    """