pyramid_mailer is missing a function to send the email to a queue path immediately without use of the transactional middleware.
Does this work for you? http://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#pyramid_mailer.mailer.Mailer.send_immediately
@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.
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.
repoze.tm currently injects a key into the environ stating that it is active environ['repoze.tm.active']. 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?
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.