From 6ddc55e28724598139b1a224b5c8675c1b6a8237 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 7 Oct 2020 14:00:08 +0200 Subject: [PATCH] new settings IF_EMAIL --- foerderbarometer/settings.py | 3 +++ input/views.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/foerderbarometer/settings.py b/foerderbarometer/settings.py index 4f7a3b9..69b0a66 100644 --- a/foerderbarometer/settings.py +++ b/foerderbarometer/settings.py @@ -15,6 +15,9 @@ from pathlib import Path # mails in development go to stdout EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +# mail for IF-OTRS +IF_EMAIL = 'if-test@wikimedia.de' + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/input/views.py b/input/views.py index 2da11cf..d5c9625 100644 --- a/input/views.py +++ b/input/views.py @@ -3,6 +3,7 @@ from django.forms import modelformset_factory from django.http import HttpResponse from formtools.wizard.views import CookieWizardView from django.core.mail import send_mail +from django.conf import settings from .forms import ProjectForm, VolunteerForm, LibraryForm, IFGForm from .models import Project @@ -90,8 +91,8 @@ class ExternView(CookieWizardView): send_mail( 'form filled', 'you are such a great form filler!', - 'if-test@wikimedia.de', - ['benni.baermann@wikimedia.de'], + settings.IF_EMAIL, + [form.email], fail_silently=False, ) # - mail to IF with link to accept/decline