1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Move mail notification logic to service layer (#26905)

Extract from #22266
This commit is contained in:
Lunny Xiao
2023-09-05 17:26:59 +08:00
committed by GitHub
parent 0b10df67ce
commit a66d883a18
3 changed files with 20 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/queue"
"code.gitea.io/gitea/modules/setting"
@@ -392,6 +393,10 @@ func NewContext(ctx context.Context) {
return
}
if setting.Service.EnableNotifyMail {
notification.RegisterNotifier(NewNotifier())
}
switch setting.MailService.Protocol {
case "sendmail":
Sender = &sendmailSender{}