Add option to change mail from user display name (#31528)

Make it posible to let mails show e.g.:

`Max Musternam (via gitea.kithara.com) <gitea@kithara.com>`

Docs: https://gitea.com/gitea/docs/pulls/23

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit 0f533241829d0d48aa16a91e7dc0614fe50bc317)

Conflicts:
	- services/mailer/mail_release.go
	  services/mailer/mail_test.go

	  In both cases, applied the changes manually.
This commit is contained in:
6543 2024-07-14 14:27:00 -07:00 committed by Gergely Nagy
parent 54f2dcff9d
commit 004cc6dc0a
No known key found for this signature in database
6 changed files with 86 additions and 3 deletions

View file

@ -79,7 +79,7 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *user_model.U
}
for _, to := range emailTos {
msg := NewMessage(to.EmailTo(), subject, content.String())
msg := NewMessageFrom(to.EmailTo(), fromDisplayName(doer), setting.MailService.FromEmail, subject, content.String())
msg.Info = fmt.Sprintf("UID: %d, repository pending transfer notification", newOwner.ID)
SendAsync(msg)