comparison gpp/core/tasks.py @ 513:9e7ae8462f3f

Using celery to send mail out of the request/response cycle.
author Brian Neal <bgneal@gmail.com>
date Tue, 13 Dec 2011 02:07:55 +0000
parents
children beda97542da8
comparison
equal deleted inserted replaced
512:3fd369e1197f 513:9e7ae8462f3f
1 """
2 Celery tasks for the core application.
3
4 """
5 from celery.task import task
6 import django.core.mail
7
8
9 @task
10 def add(x, y):
11 return x + y
12
13 @task
14 def send_mail(subject, message, from_email, recipient_list, **kwargs):
15 django.core.mail.send_mail(subject, message, from_email, recipient_list,
16 **kwargs)