On 9/28/15 9:24 PM, Mike Orr wrote:
I need to send email in my Pyramid application, and I'd like to set up
emailed exception reports like Pylons does.

I looked around and found 'pyramid_mailer' and 'pyramid_marrowmailer'.
Does anyone have any particular recommendations? I'll probably go with
'pyramid_mailer' because it looks more flexible: it can send a message
or save it to a debug directory or testing variables, either in
transaction or immediately. I may need immediate sending to tailor the
response ("Request sent" or "Try again later"). 'pyramid_marrowmailer'
says only works within a transaction.

I tried 'pyramid_mailer' and got it working in a test application,
although not yet to the point of switching modes seamlessly with just
a configuration change.

For emailed exceptions I found 'pyramid_errmail'
https://github.com/Pylons/pyramid_errmail
which uses 'pyramid_mailer', but it's not on PyPI, hasn't been updated
since Pyramid 1.2-dev (2011), has at least one major bug
('config.add_tween' now requires a dotted name, not a function
object), and I'm not sure if it's compatible with pyramid_mailer's
debug mode (it didn't write a file when I tried). However, I did get
it to email an HTML traceback, so at least that's something. Is anyone
using it, or is there anything better?

I also found 'pyramid_exclog', which logs exceptions to a Python
logger, which you can configure with an SMTP logging handler. But that
doesn't integrate with 'pyramid_mailer' or anything similar, so no
config settings or debug mode, which I'd like to have. Although it may
be the simplest and most foolproof code?

You may also want to look at https://pypi.python.org/pypi/mailinglogger, another Python logging handler. It doesn't solve the problems you mentioned with using an SMTP logging handler, but it does handle rate limiting which is nice when you've got a production system hitting a repeated exception that you're already working on. It might be a good starting point for creating a handler that integrates with pyramid_mailer for the actual sending.

David

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to