/campaign/backends/debug.py

http://django-campaign.googlecode.com/ · Python · 12 lines · 9 code · 2 blank · 1 comment · 0 complexity · cacb6e836a1c27a34f80f28168f6b7f6 MD5 · raw file

  1. # an example backend which just prints out the email instead of sending it
  2. class DebugBackend(object):
  3. def send_mail(self, email, fail_silently=False):
  4. print "Subject: %s" % email.subject
  5. print "To: %s" % email.recipients()
  6. print "======"
  7. print email.message().as_string() # the actual email message
  8. print "======"
  9. return 0
  10. backend = DebugBackend()