diff gpp/mailer/management/commands/send_mail.py @ 180:aef00df91165

Implement #63, add a queued email facility.
author Brian Neal <bgneal@gmail.com>
date Sun, 21 Mar 2010 20:33:33 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gpp/mailer/management/commands/send_mail.py	Sun Mar 21 20:33:33 2010 +0000
@@ -0,0 +1,15 @@
+"""send_mail is a custom manage.py command for the mailer application.
+It is intended to be called from a cron job periodically to send out queued
+email in bulk. This avoids doing the mailing on the HTTP request processing.
+"""
+from django.core.management.base import NoArgsCommand
+
+import mailer
+
+
+class Command(NoArgsCommand):
+    help = "Run periodically to send out queued email."
+
+    def handle_noargs(self, **options):
+        mailer.send_queued_mail()
+