Mercurial > public > sg101
diff core/tasks.py @ 892:79a71b9d0a2a
Use Reply-To header when sending mail from other users.
See issue #81.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 16 Feb 2015 20:30:48 -0600 |
parents | aeafbf3ecebf |
children |
line wrap: on
line diff
--- a/core/tasks.py Mon Feb 16 18:58:49 2015 -0600 +++ b/core/tasks.py Mon Feb 16 20:30:48 2015 -0600 @@ -4,20 +4,22 @@ """ from __future__ import absolute_import +import django.core.mail from celery import shared_task -import django.core.mail import core.whos_online @shared_task -def send_mail(subject, message, from_email, recipient_list, **kwargs): +def send_mail(**kwargs): """ A task to send mail via Django. + kwargs must be a dict of keyword arguments for an EmailMessage. + """ - django.core.mail.send_mail(subject, message, from_email, recipient_list, - **kwargs) + msg = django.core.mail.EmailMessage(**kwargs) + msg.send() @shared_task