mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 03:17:13 -04:00
Move all mail related codes from models to services/mailer (#7200)
* move all mail related codes from models to modules/mailer * fix lint * use DBContext instead Engine * use WithContext not WithEngine * Use DBContext instead of Engine * don't use defer when sess.Close() * move DBContext to context.go and add some methods * move mailer from modules/ to services * fix lint * fix tests * fix fmt * add gitea copyright * fix tests * don't expose db functions * make code clear * add DefaultDBContext * fix build * fix bug
This commit is contained in:
parent
730065a3dc
commit
5a438ee3c0
22 changed files with 253 additions and 134 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/validation"
|
||||
"code.gitea.io/gitea/routers/utils"
|
||||
"code.gitea.io/gitea/services/mailer"
|
||||
|
||||
"github.com/unknwon/com"
|
||||
"mvdan.cc/xurls/v2"
|
||||
|
@ -549,7 +550,7 @@ func CollaborationPost(ctx *context.Context) {
|
|||
}
|
||||
|
||||
if setting.Service.EnableNotifyMail {
|
||||
models.SendCollaboratorMail(u, ctx.User, ctx.Repo.Repository)
|
||||
mailer.SendCollaboratorMail(u, ctx.User, ctx.Repo.Repository)
|
||||
}
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.add_collaborator_success"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue