Browse Source

Merge branch 'fancy_testweb_mails' into test

middleware_test
Jonas Havelka 4 years ago
parent
commit
8e1b989b0d
  1. 4
      various/mail_prefixer.py

4
various/mail_prefixer.py

@ -13,8 +13,10 @@ class PrefixingMailBackend(DjangoSMTPBackend):
prefix = '[Mail z testwebu]' prefix = '[Mail z testwebu]'
for message in messages: for message in messages:
# We hope that this is a django.core.mail.message.EmailMessage # We hope that this is a django.core.mail.message.EmailMessage
if len(message.from_email) == 0 or message.from_email[0] != settings.SERVER_EMAIL:
message.subject = prefix + ' ' + message.subject message.subject = prefix + ' ' + message.subject
message.body = "Bylo by posláno na e-maily: " + str(message.recipients()) + "\n" + message.body message.body = "Bylo by posláno na e-maily: " + str(message.recipients()) + "\n\n" + message.body
message.to = settings.TESTOVACI_EMAILOVA_KONFERENCE message.to = settings.TESTOVACI_EMAILOVA_KONFERENCE
message.cc = [] message.cc = []
message.bcc = [] message.bcc = []

Loading…
Cancel
Save