From b74435f0fab4769a9a8334c47c4865356481199d Mon Sep 17 00:00:00 2001 From: Jonas Havelka Date: Tue, 25 May 2021 23:35:19 +0200 Subject: [PATCH] =?UTF-8?q?Ododstavcov=C3=A1n=C3=AD=20mail=C5=AF=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- various/mail_prefixer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/various/mail_prefixer.py b/various/mail_prefixer.py index 76545bc3..7b09a81b 100644 --- a/various/mail_prefixer.py +++ b/various/mail_prefixer.py @@ -4,7 +4,7 @@ Used to distinguish testing emails from production ones.""" # We try to monkeypatch django.core.mail.backends.smtp :-) -from django.core.mail.backends.smtp import EmailBackend as DjangoSMTPBackend +from django.core.mail.backends.console import EmailBackend as DjangoSMTPBackend from django.conf import settings class PrefixingMailBackend(DjangoSMTPBackend): @@ -14,7 +14,7 @@ class PrefixingMailBackend(DjangoSMTPBackend): for message in messages: # We hope that this is a django.core.mail.message.EmailMessage 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.cc = [] message.bcc = []