diff --git a/services/mailer/mail.go b/services/mailer/mail.go index b04925881d..14fcace1e2 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -415,8 +415,8 @@ func generateAdditionalHeaders(ctx *mailCommentContext, reason string, recipient "X-Gitea-Issue-Link": ctx.Issue.HTMLURL(), "X-Forgejo-Reason": reason, - "X-Forgejo-Sender": ctx.Doer.DisplayName(), - "X-Forgejo-Recipient": recipient.DisplayName(), + "X-Forgejo-Sender": ctx.Doer.Name, + "X-Forgejo-Recipient": recipient.Name, "X-Forgejo-Recipient-Address": recipient.Email, "X-Forgejo-Repository": repo.Name, "X-Forgejo-Repository-Path": repo.FullName(), diff --git a/services/mailer/mail_test.go b/services/mailer/mail_test.go index ed972dbb99..d01d692b61 100644 --- a/services/mailer/mail_test.go +++ b/services/mailer/mail_test.go @@ -369,6 +369,8 @@ func TestGenerateAdditionalHeaders(t *testing.T) { "X-Gitea-Repository-Link": "https://try.gitea.io/user2/repo1", "X-Gitea-Issue-ID": "1", "X-Gitea-Issue-Link": "https://try.gitea.io/user2/repo1/issues/1", + "X-Forgejo-Sender": "user2", + "X-Forgejo-Recipient": "test", } for key, value := range expected {