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",