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

added first day of employment to email subject

This commit is contained in:
Chloe Oltramari 2024-02-05 14:23:53 +01:00
parent 619b846f3a
commit f4e05a0799
1 changed files with 4 additions and 3 deletions

View File

@ -141,25 +141,26 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
context = {'data': self.beautify_data(newdata), 'contact': contact} context = {'data': self.beautify_data(newdata), 'contact': contact}
firstname = data['firstname'] firstname = data['firstname']
lastname = data['lastname'] lastname = data['lastname']
firstday = data['firstdate_employment']
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(
f'EVA: Neuzugang {firstname} {lastname} (MAILTEST)', f'EVA: Neuzugang {firstname} {lastname} {firstday} (MAILTEST)',
mail_template.render(context), mail_template.render(context),
EVA_MAIL, EVA_MAIL,
[EVA_MAIL], [EVA_MAIL],
fail_silently=False) fail_silently=False)
elif department != "SUBMITTER": elif department != "SUBMITTER":
send_mail( send_mail(
f'EVA: Neuzugang {firstname} {lastname}', f'EVA: Neuzugang {firstname} {lastname} {firstday}',
mail_template.render(context), mail_template.render(context),
EVA_MAIL, EVA_MAIL,
[MAILS[department]['MAIL']], [MAILS[department]['MAIL']],
fail_silently=False) fail_silently=False)
else: else:
send_mail( send_mail(
f'EVA: Neuzugang {firstname} {lastname}', f'EVA: Neuzugang {firstname} {lastname} {firstday}',
mail_template.render(context), mail_template.render(context),
EVA_MAIL, EVA_MAIL,
[contact], [contact],