diff --git a/konova/static/images/error_imgs/croc_technician_400_sm.png b/konova/static/images/error_imgs/croc_technician_400_sm.png new file mode 100644 index 00000000..20da9cc6 Binary files /dev/null and b/konova/static/images/error_imgs/croc_technician_400_sm.png differ diff --git a/konova/static/images/error_imgs/croc_technician_500_sm.png b/konova/static/images/error_imgs/croc_technician_500_sm.png new file mode 100644 index 00000000..0ec19d86 Binary files /dev/null and b/konova/static/images/error_imgs/croc_technician_500_sm.png differ diff --git a/konova/utils/mailer.py b/konova/utils/mailer.py index bdb60614..ce6db5e2 100644 --- a/konova/utils/mailer.py +++ b/konova/utils/mailer.py @@ -5,7 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de Created on: 09.11.20 """ -from django.core.mail import send_mail +from django.core.mail import send_mail, EmailMultiAlternatives from django.template.loader import render_to_string from django.utils.translation import gettext_lazy as _ @@ -45,6 +45,19 @@ class Mailer: auth_password=self.auth_password ) + def send_via_bcc(self, recipient_list: list, subject: str, msg: str): + """ + Sends a mail with subject and message where recipients will be masked via bcc + """ + email_obj = EmailMultiAlternatives( + subject, + msg, + self.from_mail, + bcc=recipient_list, + ) + email_obj.attach_alternative(msg, "text/html") + return email_obj.send(fail_silently=self.fail_silently) + def send_mail_shared_access_removed(self, obj, user, municipals_names): """ Send a mail if user has no access to the object anymore @@ -115,7 +128,7 @@ class Mailer: } msg = render_to_string("email/sharing/shared_access_given_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared access given").format(obj.identifier), msg @@ -141,7 +154,7 @@ class Mailer: } msg = render_to_string("email/sharing/shared_access_removed_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared access removed").format(obj.identifier), msg @@ -167,7 +180,7 @@ class Mailer: } msg = render_to_string("email/recording/shared_data_unrecorded_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared data unrecorded").format(obj.identifier), msg @@ -193,7 +206,7 @@ class Mailer: } msg = render_to_string("email/recording/shared_data_recorded_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared data recorded").format(obj.identifier), msg @@ -219,7 +232,7 @@ class Mailer: } msg = render_to_string("email/checking/shared_data_checked_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared data checked").format(obj.identifier), msg @@ -244,7 +257,7 @@ class Mailer: } msg = render_to_string("email/other/deduction_changed_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Deduction changed").format(obj.identifier), msg @@ -270,7 +283,7 @@ class Mailer: } msg = render_to_string("email/deleting/shared_data_deleted_team.html", context) user_mail_address = users_to_notify.values_list("email", flat=True) - self.send( + self.send_via_bcc( user_mail_address, _("{} - Shared data deleted").format(obj.identifier), msg diff --git a/templates/400.html b/templates/400.html index 58e29443..5c9f5c19 100644 --- a/templates/400.html +++ b/templates/400.html @@ -5,7 +5,7 @@
+
+