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

use a single template for all mails.

This commit is contained in:
Benni Bärmann 2021-01-20 09:18:18 +01:00
parent f6b4f0584b
commit 02fddf6cc3
5 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,10 @@
# sender mail adress
EVA_MAIL = 'benni.baermann@wikimedia.de' EVA_MAIL = 'benni.baermann@wikimedia.de'
# these Fields should be included in every mail
BASIC_DATA = ['firstname', 'lastname'] BASIC_DATA = ['firstname', 'lastname']
# for every department: 'MAIL' => mail adress, 'DATA': additional fields to include
MAILS = {'IT': { MAILS = {'IT': {
'MAIL': 'it@wikimedia.de', 'MAIL': 'it@wikimedia.de',
'DATA': ['laptop', 'os',], 'DATA': ['laptop', 'os',],

View File

@ -1 +0,0 @@
{% include 'evapp/dataloop.txt' %}

View File

@ -1 +0,0 @@
{% include 'evapp/dataloop.txt' %}

View File

@ -0,0 +1,9 @@
Hallo!
Es gibt einen Neuzugang bei Wikimedia! Hier (<insertlink>) kannst Du nachsehen,
welche Schritte jetzt für Deine Abteilung nötig werden. Im Folgenden alle Daten,
die Du dafür brauchst:
{% include 'evapp/dataloop.txt' %}
Grüße, Deine E.V.A.

View File

@ -63,7 +63,7 @@ class EvaFormView(CookieWizardView):
context = {'data': self.beautify_data(newdata)} context = {'data': self.beautify_data(newdata)}
try: try:
mail_template = get_template(f'evapp/{department}_mail.txt') mail_template = get_template(f'evapp/department_mail.txt')
send_mail( send_mail(
'EVA: Neuzugang', 'EVA: Neuzugang',
mail_template.render(context), mail_template.render(context),