WMDE
/
eva
forked from tohe/eva
7
1
Fork 0

removed submitter from CCs of all emails. Instead sends one email to submitter with all infos.

This commit is contained in:
Chloe Oltramari 2023-10-24 16:30:01 +02:00
parent b184564c83
commit f5f10c5414
2 changed files with 19 additions and 3 deletions

View File

@ -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'
]
}
}

View File

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