Mercurial > public > sg101
diff core/tasks.py @ 893:3aecf9058130
Merge with upstream.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 17 Feb 2015 18:59:06 -0600 |
parents | 79a71b9d0a2a |
children |
line wrap: on
line diff
--- a/core/tasks.py Tue Feb 10 20:36:34 2015 -0600 +++ b/core/tasks.py Tue Feb 17 18:59:06 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