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:
@@ -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{}
|
||||
|
Reference in New Issue
Block a user