chol
/
eva
forked from tohe/eva
1
0
Fork 0

firstname lastname added to mail subjects

This commit is contained in:
Benni Bärmann 2021-09-20 13:55:43 +02:00
parent 8cd195a336
commit ed4d47dd40
2 changed files with 4 additions and 5 deletions

2
TODO
View File

@ -1,3 +1 @@
* remove dot before "Nextcloud" at login page.
* firstname lastname in subject

View File

@ -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],