Author: brosner
Date: Fri Sep 12 21:27:14 2008
New Revision: 36

Modified:
    trunk/mailerdev/mailer/management/commands/send_mail.py

Log:
Added the ability to pause the sending of mail with MAILER_PAUSE_SEND.

Modified: trunk/mailerdev/mailer/management/commands/send_mail.py
==============================================================================
--- trunk/mailerdev/mailer/management/commands/send_mail.py     (original)
+++ trunk/mailerdev/mailer/management/commands/send_mail.py     Fri Sep 12  
21:27:14 2008
@@ -1,10 +1,18 @@
  import logging
+
+from django.conf import settings
  from django.core.management.base import NoArgsCommand
+
  from mailer.engine import send_all

+# allow a sysadmin to pause the sending of mail temporarily.
+PAUSE_SEND = getattr(settings, "MAILER_PAUSE_SEND", False)
+
  class Command(NoArgsCommand):
      help = 'Do one pass through the mail queue, attempting to send all  
mail.'

      def handle_noargs(self, **options):
          logging.basicConfig(level=logging.DEBUG, format="%(message)s")
-        send_all()
+        # if PAUSE_SEND is turned on don't do anything.
+        if not PAUSE_SEND:
+            send_all()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to