view gpp/mailer/management/commands/send_mail.py @ 334:6805d15cda13

Adding a script I had to write on the fly to filter out posts from the posts csv file that had no parent topics. MyISAM let me get away with that, but InnoDB won't.
author Brian Neal <bgneal@gmail.com>
date Sat, 26 Feb 2011 01:28:22 +0000
parents aef00df91165
children
line wrap: on
line source
"""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()