Repository navigation
feat: mail module, and tenant invitations are emailed (#496) - #562
Merged
Merged
Conversation
…alth check) (#496) Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
… cite revision Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…d after-commit wiring Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Queue invitation mail only when a transport is installed and the link is absolute, so the one-time token never sits in the outbox for nothing; a worker without the mail module fails the delivery (retry) instead of marking it sent. Document the token-in-outbox trade-off. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
SMTP operations time out after 15s, and the tenants invitation send runs after cache invalidation and event publish in the after-commit hook. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ous result on resubmit Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Queue invitation mail only for a sender that delivers; docs name the mail.mailer check and the mail settings section. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
7a3cc52
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1569d8b8.simple-module-python.pages.dev |
| Branch Preview URL: | https://feat-mail-module-496.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #496
Summary
mailmodule (simple_module_mail) owns outgoing mail. It provides the SMTP or console transport, its settings (backend,smtp_*, with the port limited to 1–65535), a 15 s SMTP timeout, and the on-demandmail.mailercheck behind "Test mailer connection". A data migration (d7b3a9e5c1f2) moves the storedusers.mailer/users.smtp_*rows tomail.*.simple_module_core.mailprovidesMailMessage, theMailSenderprotocol,current_mail_sender()andresolve_mail_sender(db).captured_mailpytest fixture is new.userssends through the core sender (TemplatedMailer). Templates, subjects and theMailerprotocol are unchanged, andsimple_module_usersnow depends onsimple_module_mail.tenantsemails invitations.background_tasksinstalled, the email goes through the durable outbox (tenants.send_invitation_email, retried). Otherwise it is sent after commit.public_base_url).Mailfails the delivery so it retries, instead of marking it sent.InvitationIssued.emailedis new, and the invite form now says "Invitation emailed to …" or "Not emailed — share this link". The link and copy button stay in both cases.Behaviour changes (in the CHANGELOG): the users mailer settings moved to
mail, and theusers.mailerhealth check is nowmail.mailer.Known trade-off (documented in
docs/modules/tenants.md): an outbox-delivered invitation keeps its accept link, one-time token included, in the outbox row until thebackground_tasksretention purge.Verification
/shipran optimize, two review rounds (clean) and two browser QA rounds. QA used a local SMTP sink and a Celery outbox worker against a multi-tenant SQLite stack.main:make lintpasses,make test-py4952 passed / 22 skipped,make test-js668 passed.make migrations-roundtrip-pgwas not run locally; CI runs it.QA Report
smtp_portaccepted -1/0/99999) and fixed. A stale "emailed" banner on a duplicate invite was also fixed.Follow-ups (not in this PR)
smtp_tlsis on, carried over fromusers. STARTTLS support would be a separate change.simple_module_mailpackage, or its publish job fails.Test plan
public_base_url, invite someone from/tenants/members, and confirm the email arrives with the accept link.migrations-roundtrip-pg.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4