Browse Source

moved additional survey mails from TO to BCC fields

master
Benni Baermann 3 years ago
parent
commit
837b0bd9d5
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      input/management/commands/sendmails.py

+ 5
- 4
input/management/commands/sendmails.py View File

@ -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.')

Loading…
Cancel
Save