From 837b0bd9d5fbe6a2c98e4735978c17c8285868db Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 14 Apr 2021 14:37:49 +0200 Subject: [PATCH] moved additional survey mails from TO to BCC fields --- input/management/commands/sendmails.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/input/management/commands/sendmails.py b/input/management/commands/sendmails.py index d8c65da..312f3e6 100644 --- a/input/management/commands/sendmails.py +++ b/input/management/commands/sendmails.py @@ -3,7 +3,7 @@ import sys from django.core.management.base import BaseCommand, CommandError from django.template.loader import get_template -from django.core.mail import send_mail, BadHeaderError +from django.core.mail import send_mail, BadHeaderError, EmailMessage from django.conf import settings from input.models import Project, Library, HonoraryCertificate, Travel, Email,\ @@ -36,11 +36,12 @@ class Command(BaseCommand): 'SURVEYPREFIX': SURVEYPREFIX, } mail_template = get_template('input/survey_mail.txt') try: - send_mail('Dein Feedback zur Förderung durch Wikimedia Deutschland', + survey_mail = EmailMessage('Dein Feedback zur Förderung durch Wikimedia Deutschland', mail_template.render(context), IF_EMAIL, - [email, SURVEY_EMAIL], - fail_silently=False) + [email], + bcc=[SURVEY_EMAIL, benni.baermann@wikimedia.de]) + survey_mail.send(fail_silently=False) except BadHeaderError: return HttpResponse('Invalid header found.')