Send reply mail from the post event bus (#16)

Stacks on #15. Handlers only persist and publish; a mail subscriber sends reply email. Unset Resend stays a no-op.

Reviewed-on: #16
Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #16.
This commit is contained in:
2026-08-29 18:25:30 +00:00
committed by codegirl007
parent 1acc296541
commit a6232ea784
6 changed files with 298 additions and 68 deletions
+6 -1
View File
@@ -9,6 +9,7 @@ import (
"testing"
"time"
"plumber/internal/events"
"plumber/internal/mail"
"plumber/internal/pacific"
"plumber/internal/store"
@@ -263,8 +264,12 @@ func TestEditPostRoutePermissions(t *testing.T) {
func TestPostReplyNotifications(t *testing.T) {
t.Parallel()
mem := store.NewMemory()
bus := events.New()
defer bus.Close()
recording := &mail.Recording{}
srv, mem := newTestServer(t, Config{Mail: recording})
mail.Subscribe(bus, mem, recording)
srv := newTestServerStore(t, mem, Config{Events: bus})
handler := srv.Handler()
homeowner := seedUser(t, mem, uniq("homeowner"), "hunter22", store.RoleUser)
admin := seedUser(t, mem, uniq("admin"), "hunter22", store.RoleAdmin)