mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-20 17:57:14 -04:00
Move mail notification logic to service layer (#26905)
Extract from #22266
This commit is contained in:
parent
0b10df67ce
commit
a66d883a18
3 changed files with 20 additions and 21 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue