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