Skip to content

Commit 4831ada

Browse files
committed
Add List-Unsubscribe header
Fixes #13283
1 parent 49933c7 commit 4831ada

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

services/mailer/mail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func generateAdditionalHeaders(ctx *mailCommentContext, reason string, recipient
347347
// https://datatracker.ietf.org/doc/html/rfc2369
348348
"List-Archive": fmt.Sprintf("<%s>", repo.HTMLURL()),
349349
//"List-Post": https://github.com/go-gitea/gitea/pull/13585
350-
//"List-Unsubscribe": https://github.com/go-gitea/gitea/issues/10808, https://github.com/go-gitea/gitea/issues/13283
350+
"List-Unsubscribe": ctx.Issue.HTMLURL(),
351351

352352
"X-Gitea-Reason": reason,
353353
"X-Gitea-Sender": ctx.Doer.DisplayName(),

services/mailer/mail_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ func TestGenerateAdditionalHeaders(t *testing.T) {
217217
expected := map[string]string{
218218
"List-ID": "user2/repo1 <repo1.user2.localhost>",
219219
"List-Archive": "<https://try.gitea.io/user2/repo1>",
220+
"List-Unsubscribe": "https://try.gitea.io/user2/repo1/issues/1",
220221
"X-Gitea-Reason": "dummy-reason",
221222
"X-Gitea-Sender": "< U<se>r Tw<o > ><",
222223
"X-Gitea-Recipient": "Test",

0 commit comments

Comments
 (0)