From ed4d47dd40d3a9d6675cf45262b010b4b2a59f47 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 20 Sep 2021 13:55:43 +0200 Subject: [PATCH] firstname lastname added to mail subjects --- TODO | 2 -- evapp/views.py | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index f3af4eb..03b33fd 100644 --- a/TODO +++ b/TODO @@ -1,3 +1 @@ * remove dot before "Nextcloud" at login page. - -* firstname lastname in subject diff --git a/evapp/views.py b/evapp/views.py index 615e831..6002514 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -138,19 +138,20 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): newdata.update({k: v for k, v in data.items() if (k in MAILS[department]['DATA'])}) context = {'data': self.beautify_data(newdata), 'contact': contact} - + firstname = data['firstname'] + lastname = data['lastname'] try: mail_template = get_template(f'evapp/department_mail.txt') if settings.MAILTEST: send_mail( - 'EVA: Neuzugang (MAILTEST)', + f'EVA: Neuzugang {firstname} {lastname} (MAILTEST)', mail_template.render(context), EVA_MAIL, [EVA_MAIL, contact], fail_silently=False) else: send_mail( - 'EVA: Neuzugang', + f'EVA: Neuzugang {firstname} {lastname}', mail_template.render(context), EVA_MAIL, [MAILS[department]['MAIL'], contact],