--- id: repoze-sendmail version: "4.5" license: LicenseRef-Repoze-BSD-derived license_treatment: permissive maintenance: active --- # repoze-sendmail — Couple sending email message with a transaction License: permissive · Maintenance: active · Downloads: 78.5K/mo ## What it is and what it does repoze.sendmail integrates email sending with the Zope transaction manager, deferring message dispatch until a transaction commits. This prevents users from receiving notifications about incomplete operations—if a transaction rolls back, the associated email is never sent. The package acts as middleware in WSGI applications, intercepting email operations and binding them to transaction lifecycle events. It's designed for web applications where email notifications must be atomic with database changes. Rather than sending mail immediately and risking orphaned messages if later steps fail, repoze.sendmail queues messages and releases them only when the transaction succeeds. This is particularly useful in long-running request handlers or batch operations where partial failure is possible. Use it for: - Send confirmation emails only after a user registration transaction commits successfully - Queue password-reset notifications that are discarded if the reset transaction rolls back - Defer order-confirmation emails until inventory and payment transactions complete - Batch email dispatch tied to database transaction boundaries in WSGI applications - Prevent duplicate or orphaned notifications in systems with nested or retried transactions ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Couples email sending with Zope transactions, ensuring messages are only sent when a transaction commits successfully. Yes, if you use Zope transactions and need email atomicity. The package is mature, actively maintained, has no known vulnerabilities, and installs with zero dependencies. It solves a real problem in transactional web applications. Not relevant for projects outside the Zope ecosystem or those not requiring transaction-coupled email. ## Install pip install repoze-sendmail uv add repoze-sendmail poetry add repoze-sendmail ## Installing repoze-sendmail Before you install: Low install friction with no runtime dependencies. Active maintenance with recent commits; supports current Python versions on both CPython and PyPy. License in practice: Licensed under a permissive Repoze BSD-derived license, allowing use in most commercial and open-source projects without significant restriction. Quickstart: pip install repoze-sendmail from repoze.sendmail import get_mailer mailer = get_mailer() mailer.send(message) # sent only on transaction commit Requires Zope transaction manager integration in your application; not a standalone email library. Verify before relying: - Whether the package works with transaction managers other than Zope's - Specific retry and queue behavior when transaction commits fail or are rolled back - Configuration and setup steps beyond basic import and usage ## Package facts - License: LicenseRef-Repoze-BSD-derived (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 78.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags transactional email sending, zope transaction email, deferred email delivery, wsgi email middleware, commit-time email dispatch, transactional-email, zope-integration [View on SkillFed](https://skillfed.io/packages/repoze-sendmail) · [View on PyPI](https://pypi.org/project/repoze-sendmail/)