summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-25 21:37:18 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-25 21:37:18 -0400
commitc1a3d4fefbbbf332cd1cedda66e93bf40cc9713d (patch)
treeb3eb7a817533770f172744b4e5dbb0360f6657bc /routers/repo/issue.go
parentbc5316b82ed20a4392cac6a57b86efcd467cef09 (diff)
downloadgitea-c1a3d4fefbbbf332cd1cedda66e93bf40cc9713d.tar.gz
gitea-c1a3d4fefbbbf332cd1cedda66e93bf40cc9713d.zip
Add mail notify for creating issue
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index fc5bb98643..242593ff29 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))
}