diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-10-27 00:42:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 12:42:27 -0400 |
commit | 38d11eea58c6618fbab1a83e1637201964100e9a (patch) | |
tree | 78d63ac3be1259d2c60943073aeb2340b3834469 /modules/private | |
parent | dbebc6b0e3a54b39c92a026be7b9ac270a20ea27 (diff) | |
download | gitea-38d11eea58c6618fbab1a83e1637201964100e9a.tar.gz gitea-38d11eea58c6618fbab1a83e1637201964100e9a.zip |
Fix send mail (#13312)
* Fix send mail
* Fix send mail
* Update modules/private/mail.go
Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/mail.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/private/mail.go b/modules/private/mail.go index db56009bb9..675dec8f11 100644 --- a/modules/private/mail.go +++ b/modules/private/mail.go @@ -49,5 +49,10 @@ func SendEmail(subject, message string, to []string) (int, string) { return http.StatusInternalServerError, fmt.Sprintf("Response body error: %v", err.Error()) } - return http.StatusOK, fmt.Sprintf("Was sent %s from %d", body, len(to)) + var users = fmt.Sprintf("%d", len(to)) + if len(to) == 0 { + users = "all" + } + + return http.StatusOK, fmt.Sprintf("Sent %s email(s) to %s users", body, users) } |