Skip to content

Add member email history and record transactional emails#33

Merged
fordprefect480 merged 2 commits into
mainfrom
claude/admin-member-email-history-y93gig
Jun 27, 2026
Merged

Add member email history and record transactional emails#33
fordprefect480 merged 2 commits into
mainfrom
claude/admin-member-email-history-y93gig

Conversation

@fordprefect480

Copy link
Copy Markdown
Owner

Summary

Adds a history of every email a member has received to the admin member-detail page, and records all transactional emails (not just newsletters) in the shared sent-email history so they show up there.

Member email history

  • New GET /api/admin/members/{id}/emails endpoint (ListMemberEmailsEndpoint) listing the SentEmail records a member was a recipient of, newest first, with the delivery status specific to that member.
  • New Email history card on MemberDetail, each row linking through to the full sent-email view.

Record transactional emails

  • New TransactionalEmailSender that sends a single email via Resend and writes a SentEmail + SentEmailRecipient, mirroring the newsletter sender.
  • Routed every transactional send site through it:
    • Password reset (IdentityEmailSender) → member
    • Membership welcome (MembershipActivationService) → member
    • Leased-bed assignment (LeasedBedNotifications) → member
    • Bed application / waitlist + contact form → admin notification address (no member attached)
  • Member-directed emails carry the recipient's UserId, so they appear in the member's email history; all transactional emails also appear in the admin Email list.
  • Delivery failures are recorded with their error and never thrown, preserving the prior fire-and-forget behaviour. Test-tool preview emails are intentionally left unrecorded.

Notes

  • Could not build locally (no .NET 10 SDK available in the dev environment; egress policy blocked the SDK download), so relying on CI to verify the server build.
  • Security consideration: password-reset emails store the full HTML body (including the reset link) in the DB, viewable by admins via the email detail page. Left as-is per request; can redact if desired.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits June 26, 2026 21:28
Surface every email a member has received on their admin detail page.
Adds a GET /members/{id}/emails endpoint that lists the SentEmail records
the member was a recipient of (newest first), with the delivery status
specific to that member, and an 'Email history' card on MemberDetail that
links each entry through to the full sent-email view.
Route every transactional email (password reset, membership welcome, bed
assignment, bed-application and contact-form notifications) through a new
TransactionalEmailSender that sends via Resend and records a SentEmail +
SentEmailRecipient, mirroring how the newsletter sender already does it.

Member-directed emails carry the recipient's UserId, so they now appear in
the member detail page's email history; all transactional emails also show
in the admin Email list. Delivery failures are recorded with their error and
never thrown, preserving the previous fire-and-forget behaviour. Test-tool
preview emails are intentionally left unrecorded.
@fordprefect480 fordprefect480 merged commit dc70797 into main Jun 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants