summaryrefslogtreecommitdiffstats
path: root/routers/admin/admin.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-02-24 23:59:17 -0500
committerUnknwon <u@gogs.io>2016-02-24 23:59:17 -0500
commitbaaf6046a1b0b81b91c76ecc259a13f9eb1c5cdb (patch)
tree2597d4ada58b2d555594dd2152224edc0cd36411 /routers/admin/admin.go
parent5418c2c5e45ba013938666f8c64c0a60a61a1398 (diff)
downloadgitea-baaf6046a1b0b81b91c76ecc259a13f9eb1c5cdb.tar.gz
gitea-baaf6046a1b0b81b91c76ecc259a13f9eb1c5cdb.zip
Minor fix for #2660
Diffstat (limited to 'routers/admin/admin.go')
-rw-r--r--routers/admin/admin.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 721a9664c1..db86abb84a 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -175,9 +175,14 @@ 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)
+func SendTestMail(ctx *middleware.Context) {
+ email := ctx.Query("email")
+ // Send a test email to the user's email address and redirect back to Config
+ if err := mailer.SendTestMail(email); err != nil {
+ ctx.Flash.Error(ctx.Tr("admin.config.test_mail_failed", email, err))
+ } else {
+ ctx.Flash.Info(ctx.Tr("admin.config.test_mail_sent", email))
+ }
ctx.Redirect(setting.AppSubUrl + "/admin/config")
}