Skip to content

Cannot send to queue immediately #23

rbu opened this Issue Oct 25, 2012 · 5 comments

4 participants

rbu commented Oct 25, 2012

pyramid_mailer is missing a function to send the email to a queue path immediately without use of the transactional middleware.

rbu commented Nov 14, 2012

@graffic, this sends the email to a local smtp directly. What I need is the functionality of send_to_queue but without the transactional manager.

Pylons Project member

If we knew that the transaction manager were active we could modify the api such that send_to_queue and send had an optional use_transaction parameter that had 3 states. _marker would be the default and would add it to a transaction if one were active or send immediately if not, True would raise an error if no transaction is active, and False would send immediately. We'd also probably deprecate send_immediately. currently injects a key into the environ stating that it is active environ['']. Unfortunately, pyramid_tm does not do that, but if it were updated to do so, something like this could be supported.

@mcdonc any thoughts on this?

Pylons Project member

I've added a note to the docs that this is not supported and provided a code snippet on how to make it work via an explicit commit. pyramid_mailer is heavily dependent on repoze.sendmail which comes with the explicit contract that it sends mail via transactions. The fact that the send_immediately api works is really a side-effect of the rest of repoze.sendmail.


@mmerickel I'm assuming your last comment means this issue is closed.

@rpatterson rpatterson closed this Mar 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.