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'
# these Fields should be included in every mail
BASIC_DATA = ['firstname', 'lastname']
# for every department: 'MAIL' => mail adress, 'DATA': additional fields to include
MAILS = {'IT': {
'MAIL': 'it@wikimedia.de',
'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)}
try:
mail_template = get_template(f'evapp/{department}_mail.txt')
mail_template = get_template(f'evapp/department_mail.txt')
send_mail(
'EVA: Neuzugang',
mail_template.render(context),