mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 23:06:30 +00:00
Add mail notify for creating issue
This commit is contained in:
1 parent
bc5316b82e
commit
c1a3d4fefb
5 files changed
+49
-5
No files matched your search
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/mailer"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
)
|
||||
|
||||
@@ -86,6 +87,14 @@ func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
|
||||
return
|
||||
}
|
||||
|
||||
// Mail watchers.
|
||||
if base.Service.NotifyMail {
|
||||
if err = mailer.SendNotifyMail(ctx.User.Id, ctx.Repo.Repository.Id, ctx.User.Name, ctx.Repo.Repository.Name, issue.Name, issue.Content); err != nil {
|
||||
ctx.Handle(200, "issue.CreateIssue", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
log.Trace("%d Issue created: %d", ctx.Repo.Repository.Id, issue.Id)
|
||||
ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", params["username"], params["reponame"], issue.Index))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user