WMDE
/
eva
forked from tohe/eva
7
1
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. * 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'])}) newdata.update({k: v for k, v in data.items() if (k in MAILS[department]['DATA'])})
context = {'data': self.beautify_data(newdata), 'contact': contact} context = {'data': self.beautify_data(newdata), 'contact': contact}
firstname = data['firstname']
lastname = data['lastname']
try: try:
mail_template = get_template(f'evapp/department_mail.txt') mail_template = get_template(f'evapp/department_mail.txt')
if settings.MAILTEST: if settings.MAILTEST:
send_mail( send_mail(
'EVA: Neuzugang (MAILTEST)', f'EVA: Neuzugang {firstname} {lastname} (MAILTEST)',
mail_template.render(context), mail_template.render(context),
EVA_MAIL, EVA_MAIL,
[EVA_MAIL, contact], [EVA_MAIL, contact],
fail_silently=False) fail_silently=False)
else: else:
send_mail( send_mail(
'EVA: Neuzugang', f'EVA: Neuzugang {firstname} {lastname}',
mail_template.render(context), mail_template.render(context),
EVA_MAIL, EVA_MAIL,
[MAILS[department]['MAIL'], contact], [MAILS[department]['MAIL'], contact],