mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-23 14:00:03 +02:00
Fix send mail (#13312)
* Fix send mail * Fix send mail * Update modules/private/mail.go Co-authored-by: techknowlogick <matti@mdranta.net>
This commit is contained in:
parent
dbebc6b0e3
commit
38d11eea58
3 changed files with 36 additions and 6 deletions
|
@ -9,10 +9,13 @@ import (
|
|||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/modules/private"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func runSendMail(c *cli.Context) error {
|
||||
setting.NewContext()
|
||||
|
||||
if err := argsSet(c, "title"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -38,11 +41,11 @@ func runSendMail(c *cli.Context) error {
|
|||
|
||||
status, message := private.SendEmail(subject, body, nil)
|
||||
if status != http.StatusOK {
|
||||
fmt.Printf("error: %s", message)
|
||||
fmt.Printf("error: %s\n", message)
|
||||
return nil
|
||||
}
|
||||
|
||||
fmt.Printf("Succseded: %s", message)
|
||||
fmt.Printf("Success: %s\n", message)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue