Repository navigation
Email claim links to the owner, and let staff pick an existing account - #49
Merged
Merged
Conversation
Minting a claim link used to hand staff a URL to send themselves. Now the server emails it to the address it was minted for, and staff can choose that address from existing accounts instead of typing it. - New `claim_invite` email, sent by `claims.email_claim_invite` from `staff.create_claim_invite`, so the staff route and the MCP tool both send it. It goes out inside the request, never through django-q: task arguments are kept in the database, and the link is a credential that never expires and is otherwise stored only as a hash. `claim_code` works the same way. - The response (route and MCP) carries `emailed`. A failed send is logged and reported, not raised: the invite still exists and staff still hold the link, so the panel tells them to send it by hand. - `GET /catalog/staff/users?q=` (staff only, active accounts, matched on email or name, at most 10) backs a picker under the panel's email field; choosing an account fills in its address. Redemption is unchanged. - DEVELOPMENT.md and CLAUDE.md describe the email and why it is not queued.
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.
Why
Creating a claim link handed staff a URL to copy into their own email client. Staff also had to retype the owner's address, even when the owner already has an account.
What
claim_inviteemail (MJML, text,preview.json), sent fromstaff.create_claim_invite, so both the tool-page panel and thecatalog_create_claim_inviteMCP tool send it.claim_codealready follows the same rule.emailedin the response. A failed send is logged and returned asemailed: falseinstead of failing the request. The invite exists and the panel shows the link with a warning to send it by hand. On success it says "Emailed to …".GET /api/v1/catalog/staff/users?q=(staff only, 403 otherwise; active accounts matched on email or name; max 10). The minter lists matches under the email field once 2+ characters are typed, and clicking one fills in the address. The owner still accepts the invite while signed in, so the audit trail is unchanged.DEVELOPMENT.md(claim links, email table, queue note) andCLAUDE.md.make schemaregeneratedopenapi.jsonand the Orval client.make backend-emailscompiledbody.html.Tests
emailed: false; the route and MCP reportemailed; account search by email or name; non-staff get 403; deactivated accounts are skipped.