forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into ensure-user-email-i…
…s-stored-in-email-address-table * origin/master: [UI] Hide consecutive additions and removals of the same label (go-gitea#13315) [skip ci] Updated translations via Crowdin Fix send mail (go-gitea#13312) [skip ci] Updated translations via Crowdin Deny wrong pull (go-gitea#13308) Group Label Changed Comments in timeline (go-gitea#13304) [skip ci] Updated translations via Crowdin Attempt to handle unready PR in tests (go-gitea#13305) go-gitea#12897 - add mastodon provider (go-gitea#13293) [skip ci] Updated translations via Crowdin Fix Storage mapping (go-gitea#13297) Update Mirror IsEmpty status on synchronize (go-gitea#13185) Fix bug isEnd detection on getIssues/getPullRequests (go-gitea#13299) systemd service: Add commented PATH environment option for Git prefix (go-gitea#13170) Sendmail command (go-gitea#13079) Various UI and arc-green fixes (go-gitea#13291)
- Loading branch information
Showing
51 changed files
with
943 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2020 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"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 | ||
} | ||
|
||
subject := c.String("title") | ||
confirmSkiped := c.Bool("force") | ||
body := c.String("content") | ||
|
||
if !confirmSkiped { | ||
if len(body) == 0 { | ||
fmt.Print("warning: Content is empty") | ||
} | ||
|
||
fmt.Print("Proceed with sending email? [Y/n] ") | ||
isConfirmed, err := confirm() | ||
if err != nil { | ||
return err | ||
} else if !isConfirmed { | ||
fmt.Println("The mail was not sent") | ||
return nil | ||
} | ||
} | ||
|
||
status, message := private.SendEmail(subject, body, nil) | ||
if status != http.StatusOK { | ||
fmt.Printf("error: %s\n", message) | ||
return nil | ||
} | ||
|
||
fmt.Printf("Success: %s\n", message) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.