265
265
# Strip newlines from subject
266
266
subject = ''.join(render_to_string('notification/email_subject.txt', {
267
267
'message': messages['short.txt'],
270
270
# Strip leading newlines. Make writing the email templates easier:
271
271
# Each linebreak in the templates results in a linebreak in the emails
272
272
# If the first line in a template contains only template tags the
273
273
# email will contain an empty line at the top.
274
274
body = render_to_string('notification/email_body.txt', {
275
275
'message': messages['full.txt'],
278
279
if should_send(user, notice_type, '1') and user.email: # Email
279
280
recipients.append(user.email)
280
281
send_mail(subject, body, settings.DEFAULT_FROM_EMAIL, recipients)
282
283
# reset environment to original language
283
284
activate(current_language)
284
285
except NoticeType.DoesNotExist: