MCPcopy Create free account
hub / github.com/gogs/gogs / SendTestMail

Function SendTestMail

internal/route/admin/admin.go:173–183  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

171}
172
173func SendTestMail(c *context.Context) {
174 emailAddr := c.Query("email")
175 // Send a test email to the user's email address and redirect back to Config
176 if err := email.SendTestMail(emailAddr); err != nil {
177 c.Flash.Error(c.Tr("admin.config.email.test_mail_failed", emailAddr, err))
178 } else {
179 c.Flash.Info(c.Tr("admin.config.email.test_mail_sent", emailAddr))
180 }
181
182 c.Redirect(conf.Server.Subpath + "/admin/config")
183}
184
185func Config(c *context.Context) {
186 c.Title("admin.config")

Callers

nothing calls this directly

Calls 4

SendTestMailFunction · 0.92
TrMethod · 0.80
RedirectMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected