Generalize post reply notifications (#6)
## Summary - Notify the direct parent post author for replies throughout nested conversations - Skip root creation, self-replies, edits, disabled mail, and recipients without email - Link directly to each reply and use per-reply Resend idempotency Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
|
||||
"plumber"
|
||||
"plumber/internal/blob"
|
||||
"plumber/internal/mail"
|
||||
"plumber/internal/pacific"
|
||||
"plumber/internal/store"
|
||||
)
|
||||
@@ -483,7 +484,8 @@ func TestProfileAdminAnsweredListAndAvatarUpload(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMutationsVoteAnswerHideAndCSRF(t *testing.T) {
|
||||
srv, mem := newTestServer(t, Config{})
|
||||
recording := &mail.Recording{}
|
||||
srv, mem := newTestServer(t, Config{Mail: recording})
|
||||
h := srv.Handler()
|
||||
adminName := uniq("admin")
|
||||
userName := uniq("user")
|
||||
@@ -611,6 +613,13 @@ func TestMutationsVoteAnswerHideAndCSRF(t *testing.T) {
|
||||
if got := rec.Header().Get("HX-Redirect"); got != "/questions/"+q.ID+"#post-"+adminReply.ID {
|
||||
t.Fatalf("admin answer redirect = %q", got)
|
||||
}
|
||||
msgs := waitForMail(t, recording, 1)
|
||||
if msg := msgs[0]; msg.ToEmail != user.Email ||
|
||||
msg.RootID != q.ID ||
|
||||
msg.ReplyID != adminReply.ID ||
|
||||
msg.ReplyBody != adminReply.Body {
|
||||
t.Fatalf("compatibility reply notification = %+v", msg)
|
||||
}
|
||||
|
||||
rec = httptest.NewRecorder()
|
||||
req = httptest.NewRequest(http.MethodGet, "/questions/"+q.ID, nil)
|
||||
|
||||
Reference in New Issue
Block a user