[FEATURE]: Admission and rejection emails #668
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
security
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
local-it/mitgliederverwaltung#668
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Applicants hear nothing after approval or rejection; the board writes each mail by hand. For some clubs the admission only becomes effective with the board's written consent, so the admission mail has a legal role, and the club needs to know it was sent. This is the first slice of the mail foundation of milestone 88: build it so 88 can extend templates and the sending log.
Proposal
Acceptance criteria
Dependencies
Scope addition (folded in from a separate finding):
Approval side effects must run only after the approval commits.
Mv.Membership.JoinFlow.approve_join_request/2creates the member inside oneAsh.transact(lib/mv/membership/join_flow.ex:381-407). The member'safter_transactionhooks therefore run before the commit:Mv.Vereinfacht.Changes.SyncContactstarts a backgroundSyncTaskthat re-reads the member on its own connection; before the commit it finds nothing and silently skips the sync. Whether an approved member reaches Vereinfacht depends on a race.after_transactionhooks onMv.Membership.Member.create_memberare being executed, but there is an ongoing transaction".The admission mail of this issue has the same trap: sent inside the transaction, it can go out although the approval rolls back.
Proposal: create the member in the approval with a context that skips the hook's own start (e.g.
vereinfacht_sync: :after_commit), and start the Vereinfacht sync and the admission mail only onceAsh.transactreturned{:ok, _}. Check other callers that create or update members inside a surrounding transaction (CSV import uses:inline).Additional acceptance criteria:
after_transactionwarning no longer appears for an approval; fee cycles are still generated on approval.