diff options
Diffstat (limited to 'cmd/mailer.go')
-rw-r--r-- | cmd/mailer.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cmd/mailer.go b/cmd/mailer.go index d05fee12bc..50ba4b4741 100644 --- a/cmd/mailer.go +++ b/cmd/mailer.go @@ -5,7 +5,6 @@ package cmd import ( "fmt" - "net/http" "code.gitea.io/gitea/modules/private" "code.gitea.io/gitea/modules/setting" @@ -43,13 +42,10 @@ func runSendMail(c *cli.Context) error { } } - status, message := private.SendEmail(ctx, subject, body, nil) - if status != http.StatusOK { - fmt.Printf("error: %s\n", message) - return nil + respText, extra := private.SendEmail(ctx, subject, body, nil) + if extra.HasError() { + return handleCliResponseExtra(extra) } - - fmt.Printf("Success: %s\n", message) - + _, _ = fmt.Printf("Sent %s email(s) to all users\n", respText) return nil } |