From f5f10c5414611e7fdc3262fd870eea94cfa0b124 Mon Sep 17 00:00:00 2001 From: chol Date: Tue, 24 Oct 2023 16:30:01 +0200 Subject: [PATCH] removed submitter from CCs of all emails. Instead sends one email to submitter with all infos. --- evapp/settings.py | 11 ++++++++++- evapp/views.py | 11 +++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/evapp/settings.py b/evapp/settings.py index abeec86..9d4442b 100644 --- a/evapp/settings.py +++ b/evapp/settings.py @@ -9,6 +9,7 @@ BASIC_DATA = ['firstname', 'lastname', 'firstdate_employment', 'firstdate_presen 'jobdescription_german', 'jobdescription_english',] # for every department: 'MAIL' => mail adress, 'DATA': additional fields to include +# also one copy with all fields to the person filling the form. MAILS = { 'IT': { 'MAIL': 'wmde-it@wikimedia.de', @@ -28,7 +29,7 @@ MAILS = { 'KOMM': { 'MAIL': 'presse@wikimedia.de', 'DATA': [ - 'department', 'team', + 'department', 'team', 'add_to_wikimediade' ], }, 'CENTRAL': { @@ -54,5 +55,13 @@ MAILS = { 'DATA': [ 'rebu2go' ] + }, + 'SUBMITTER': { + 'MAIL': 'submitter@wikimedia.de', + 'DATA': [ + 'department', 'team', 'add_to_wikimediade', 'remote', 'desk', 'vendor', + 'os', 'screen', 'mobile', 'landline', 'keyboard', 'comment', 'language', + 'accounts', 'lists', 'rebu2go', 'transponder', 'special', 'post_office_box' + ] } } diff --git a/evapp/views.py b/evapp/views.py index 0491415..72f5914 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -148,14 +148,21 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): f'EVA: Neuzugang {firstname} {lastname} (MAILTEST)', mail_template.render(context), EVA_MAIL, - [EVA_MAIL, contact], + [EVA_MAIL], + fail_silently=False) + elif department != "SUBMITTER": + send_mail( + f'EVA: Neuzugang {firstname} {lastname}', + mail_template.render(context), + EVA_MAIL, + [MAILS[department]['MAIL']], fail_silently=False) else: send_mail( f'EVA: Neuzugang {firstname} {lastname}', mail_template.render(context), EVA_MAIL, - [MAILS[department]['MAIL'], contact], + [contact], fail_silently=False) except BadHeaderError as error: print(error)