From 948bb4038cfebd5f6606eff99c70825db527e557 Mon Sep 17 00:00:00 2001 From: Rhenan Bartels Date: Thu, 8 Apr 2021 16:37:19 -0300 Subject: [PATCH] =?UTF-8?q?Envia=20email=20para=20fila=20ass=C3=ADncrona?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- brasilio_auth/management/commands/send_bulk_emails.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brasilio_auth/management/commands/send_bulk_emails.py b/brasilio_auth/management/commands/send_bulk_emails.py index 8a3a5784..0c1b9968 100644 --- a/brasilio_auth/management/commands/send_bulk_emails.py +++ b/brasilio_auth/management/commands/send_bulk_emails.py @@ -1,3 +1,4 @@ +import django_rq import rows from django.core.management.base import BaseCommand from django.template import Context, Template @@ -24,7 +25,8 @@ def handle(self, *args, **kwargs): context = Context(row._asdict()) rendered_template = template_obj.render(context=context) if not kwargs["dry_run"]: - send_email( + django_rq.enqueue( + send_email, subject="Subject", body=rendered_template, from_email="from@example.com",