From 9751d19401a64ae376b744d02795e246151ec0a2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 6 May 2026 10:52:32 +0200 Subject: [PATCH] Add desbanear_usuario task to send unban email notifications --- tienda/tasks.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tienda/tasks.py b/tienda/tasks.py index 2b7dfba..680016f 100644 --- a/tienda/tasks.py +++ b/tienda/tasks.py @@ -29,6 +29,17 @@ def banear_usuario(email_usuario: str): ) send_hemail(email_usuario, "Cuenta Bloqueada", html_content, "Tu cuenta ha sido bloqueada...") + +@shared_task +def desbanear_usuario(email_usuario: str): + html_content = render_to_string( + 'emails/unban.html', + {}, + using='jinja2' + ) + + send_hemail(email_usuario, "Cuenta Desbloqueada", html_content, "Tu cuenta ha sido desbloqueada...") + @shared_task def enviar_correo_confirmacion(id: int): usuario = User.objects.get(id=id)