From c1a3d4fefbbbf332cd1cedda66e93bf40cc9713d Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 25 Mar 2014 21:37:18 -0400 Subject: Add mail notify for creating issue --- routers/repo/issue.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'routers') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index fc5bb986..242593ff 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -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)) } -- cgit v1.2.3