# 63 Mail data deleted

* adds mail sending if shared data is deleted
* adds/updates translations
* refactors recording mails into separate email template folder email/recording
This commit is contained in:
2022-01-12 15:31:25 +01:00
parent d7a9f72c3e
commit 5295c08d99
10 changed files with 160 additions and 68 deletions

View File

@@ -94,7 +94,7 @@ class Mailer:
)
def send_mail_shared_data_recorded(self, obj_identifier, user):
""" Send a mail if user just got access to the object
""" Send a mail if the user's shared data has just been unrecorded
Args:
obj_identifier (str): The object identifier
@@ -107,7 +107,7 @@ class Mailer:
"obj_identifier": obj_identifier,
"EMAIL_REPLY_TO": EMAIL_REPLY_TO,
}
msg = render_to_string("email/sharing/shared_data_recorded.html", context)
msg = render_to_string("email/recording/shared_data_recorded.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
@@ -116,6 +116,28 @@ class Mailer:
)
def send_mail_shared_data_unrecorded(self, obj_identifier, user):
""" Send a mail if the user's shared data has just been unrecorded
Args:
obj_identifier (str): The object identifier
Returns:
"""
context = {
"user": user,
"obj_identifier": obj_identifier,
"EMAIL_REPLY_TO": EMAIL_REPLY_TO,
}
msg = render_to_string("email/recording/shared_data_unrecorded.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
_("{} - Shared data unrecorded").format(obj_identifier),
msg
)
def send_mail_shared_data_deleted(self, obj_identifier, user):
""" Send a mail if user just got access to the object
Args:
@@ -129,11 +151,11 @@ class Mailer:
"obj_identifier": obj_identifier,
"EMAIL_REPLY_TO": EMAIL_REPLY_TO,
}
msg = render_to_string("email/sharing/shared_data_unrecorded.html", context)
msg = render_to_string("email/deleting/shared_data_deleted.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
_("{} - Shared data unrecorded").format(obj_identifier),
_("{} - Shared data deleted").format(obj_identifier),
msg
)