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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 21 deletions

View file

@ -15,10 +15,8 @@ import (
"code.gitea.io/gitea/modules/notification/action"
"code.gitea.io/gitea/modules/notification/base"
"code.gitea.io/gitea/modules/notification/indexer"
"code.gitea.io/gitea/modules/notification/mail"
"code.gitea.io/gitea/modules/notification/ui"
"code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
)
var notifiers []base.Notifier
@ -32,9 +30,6 @@ func RegisterNotifier(notifier base.Notifier) {
// NewContext registers notification handlers
func NewContext() {
RegisterNotifier(ui.NewNotifier())
if setting.Service.EnableNotifyMail {
RegisterNotifier(mail.NewNotifier())
}
RegisterNotifier(indexer.NewNotifier())
RegisterNotifier(action.NewNotifier())
}