Permalink
Browse files

Don't silently ignore rejected messages if fail_silently is not set

  • Loading branch information...
1 parent 6b9a280 commit 94039dbf3fe0d04f83eb7450e6de40581d3527d6 @dconlon dconlon committed Jun 7, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 templated_email/backends/postageapp_backend.py
View
@@ -7,6 +7,9 @@
from . import HeaderNotSupportedException
+class PostageAppException(Exception):
+ pass
+
class TemplateBackend:
"""
Backend which uses PostageApp to send templated emails
@@ -39,6 +42,8 @@ def send(self, template_name, from_email, recipient_list, context, cc=[], bcc=[]
variables=context,
headers=headers
)
+ if not result:
+ raise PostageAppException( self.conn.error )
except Exception, e:
if not fail_silently:
raise

0 comments on commit 94039db

Please sign in to comment.