moved additional survey mails from TO to BCC fields

This commit is contained in:
Benni Bärmann 2021-04-14 14:37:49 +02:00
parent b289df8dd3
commit 837b0bd9d5
1 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@ import sys
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.template.loader import get_template 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 django.conf import settings
from input.models import Project, Library, HonoraryCertificate, Travel, Email,\ from input.models import Project, Library, HonoraryCertificate, Travel, Email,\
@ -36,11 +36,12 @@ class Command(BaseCommand):
'SURVEYPREFIX': SURVEYPREFIX, } 'SURVEYPREFIX': SURVEYPREFIX, }
mail_template = get_template('input/survey_mail.txt') mail_template = get_template('input/survey_mail.txt')
try: 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), mail_template.render(context),
IF_EMAIL, IF_EMAIL,
[email, SURVEY_EMAIL], [email],
fail_silently=False) bcc=[SURVEY_EMAIL, benni.baermann@wikimedia.de])
survey_mail.send(fail_silently=False)
except BadHeaderError: except BadHeaderError:
return HttpResponse('Invalid header found.') return HttpResponse('Invalid header found.')