Mercurial > public > sg101
annotate gpp/mailer/management/commands/send_mail.py @ 285:8fd4984d5c3b
This is a first rough commit for #95, adding the ability to embed YouTube videos in forum posts. Some more polish and testing needs to happen at this point. I wanted to get all these changes off my hard drive and into the repository.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 14 Oct 2010 02:39:35 +0000 |
parents | aef00df91165 |
children |
rev | line source |
---|---|
bgneal@180 | 1 """send_mail is a custom manage.py command for the mailer application. |
bgneal@180 | 2 It is intended to be called from a cron job periodically to send out queued |
bgneal@180 | 3 email in bulk. This avoids doing the mailing on the HTTP request processing. |
bgneal@180 | 4 """ |
bgneal@180 | 5 from django.core.management.base import NoArgsCommand |
bgneal@180 | 6 |
bgneal@180 | 7 import mailer |
bgneal@180 | 8 |
bgneal@180 | 9 |
bgneal@180 | 10 class Command(NoArgsCommand): |
bgneal@180 | 11 help = "Run periodically to send out queued email." |
bgneal@180 | 12 |
bgneal@180 | 13 def handle_noargs(self, **options): |
bgneal@180 | 14 mailer.send_queued_mail() |
bgneal@180 | 15 |