From dfe7f80d93a518f0537b94b45a5612e8ea70d1ba Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Tue, 13 Mar 2018 14:31:03 +0300 Subject: [PATCH] Set send_email async --- apps/notification/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/notification/utils.py b/apps/notification/utils.py index bc206a13..c04b3c0e 100644 --- a/apps/notification/utils.py +++ b/apps/notification/utils.py @@ -3,8 +3,10 @@ from twilio.rest import Client from django.core.mail import EmailMessage from django.conf import settings from django.template.loader import get_template +from project.celery import app +@app.task def send_email(subject, to_email, template_name, **kwargs): html = get_template(template_name).render(kwargs) email = EmailMessage(subject, html, to=[to_email])