Mail sending

* adds mail sending logic for new notification setting
* adds new templates for user and team based sending
* enhances all email template layout
* adds translations
This commit is contained in:
2022-08-10 08:59:24 +02:00
parent 3d10e84852
commit 890911c2dc
23 changed files with 300 additions and 22 deletions

View File

@@ -95,6 +95,20 @@ class Team(UuidModel, DeletableObjectMixin):
mailer = Mailer()
mailer.send_mail_shared_data_checked_team(obj_identifier, obj_title, self)
def send_mail_deduction_changed(self, obj_identifier, obj_title, data_changes):
""" Sends a mail to the team members in case of changed deduction values
Args:
obj_identifier (str): Identifier of the main object
obj_title (str): Title of the main object
data_changes (dict): Contains the old|new changes of the deduction changes
Returns:
"""
mailer = Mailer()
mailer.send_mail_deduction_changed_team(obj_identifier, obj_title, self, data_changes)
def send_mail_shared_data_deleted(self, obj_identifier, obj_title):
""" Sends a mail to the team members in case of deleted data

View File

@@ -145,6 +145,22 @@ class User(AbstractUser):
mailer = Mailer()
mailer.send_mail_shared_data_checked(obj_identifier, obj_title, self)
def send_mail_deduction_changed(self, obj_identifier, obj_title, data_changes):
""" Sends a mail to the user in case of a changed deduction
Args:
obj_identifier (str): Identifier of the main object
obj_title (str): Title of the main object
data_changes (dict): Contains the old|new changes of the deduction changes
Returns:
"""
notification_set = self.is_notification_setting_set(UserNotificationEnum.NOTIFY_ON_DEDUCTION_CHANGES)
if notification_set:
mailer = Mailer()
mailer.send_mail_deduction_changed(obj_identifier, obj_title, self, data_changes)
def get_API_token(self):
""" Getter for an API token