Skip to content

Commit

Permalink
Envia email para fila assíncrona
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenanbartels committed Apr 8, 2021
1 parent 130f042 commit 948bb40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion brasilio_auth/management/commands/send_bulk_emails.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import django_rq
import rows
from django.core.management.base import BaseCommand
from django.template import Context, Template
Expand All @@ -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="[email protected]",
Expand Down

0 comments on commit 948bb40

Please sign in to comment.