summaryrefslogtreecommitdiffstats
path: root/routers/admin/admin.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-02-24 23:26:32 -0500
committerUnknwon <u@gogs.io>2016-02-24 23:26:32 -0500
commit5418c2c5e45ba013938666f8c64c0a60a61a1398 (patch)
treec7c5ebb74c5d4639550eea9f5042073f125466ed /routers/admin/admin.go
parentd324500959c06e975921790f8770aa5d1bdf2344 (diff)
parentc27038e392c87634c7a85674eeb2336c5074e5a3 (diff)
downloadgitea-5418c2c5e45ba013938666f8c64c0a60a61a1398.tar.gz
gitea-5418c2c5e45ba013938666f8c64c0a60a61a1398.zip
Merge pull request #2660 from joshfng/config-test-mailer
Test mailer button. Addresses #1531
Diffstat (limited to 'routers/admin/admin.go')
-rw-r--r--routers/admin/admin.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 27f2fa5b24..721a9664c1 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -16,6 +16,7 @@ import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/cron"
+ "github.com/gogits/gogs/modules/mailer"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/process"
"github.com/gogits/gogs/modules/setting"
@@ -174,6 +175,13 @@ func Dashboard(ctx *middleware.Context) {
ctx.HTML(200, DASHBOARD)
}
+func TestMailer(ctx *middleware.Context) {
+ // send a test email to the user's email address and redirect back to Config
+ mailer.SendTestMail(ctx.User)
+
+ ctx.Redirect(setting.AppSubUrl + "/admin/config")
+}
+
func Config(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("admin.config")
ctx.Data["PageIsAdmin"] = true