mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Add mail notify for creating issue
This commit is contained in:
@@ -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