# 63 Mail background sending

* moves mail sending to background using celery
This commit is contained in:
2022-01-12 14:27:39 +01:00
parent 9c4bab3800
commit dbf32f3138
5 changed files with 18 additions and 10 deletions

View File

@@ -49,7 +49,7 @@ class Mailer:
auth_password=self.auth_password
)
def send_mail_shared_access_removed(self, obj, user):
def send_mail_shared_access_removed(self, obj_identifier, user):
""" Send a mail if user has no access to the object anymore
Args:
@@ -60,14 +60,14 @@ class Mailer:
"""
context = {
"user": user,
"obj": obj,
"obj_identifier": obj_identifier,
"EMAIL_REPLY_TO": EMAIL_REPLY_TO,
}
msg = render_to_string("email/sharing/shared_access_removed.html", context)
user_mail_address = [user.email]
self.send(
user_mail_address,
_("{} - Shared access removed").format(obj.identifier),
_("{} - Shared access removed").format(obj_identifier),
msg
)