# 63 Mail recording/unrecording

* adds mail sending in case of unrecording and recording of data
* adds/updates translations
This commit is contained in:
2022-01-12 15:09:52 +01:00
parent eb54443aca
commit d7a9f72c3e
8 changed files with 230 additions and 15 deletions

View File

@@ -93,3 +93,47 @@ class Mailer:
msg
)
def send_mail_shared_data_recorded(self, obj_identifier, user):
""" Send a mail if user just got access to the object
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/sharing/shared_data_recorded.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
_("{} - Shared data recorded").format(obj_identifier),
msg
)
def send_mail_shared_data_unrecorded(self, obj_identifier, user):
""" Send a mail if user just got access to the object
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/sharing/shared_data_unrecorded.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
_("{} - Shared data unrecorded").format(obj_identifier),
msg
)