mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Fix init mail render logic (#20704)
This bug affects tests which are sending emails (#20307). Some tests reinitialise the web routes (like `TestNodeinfo`) which messed up the mail templates. There is no reason why the templates should be loaded in the routes method.
This commit is contained in:
@@ -55,12 +55,6 @@ var (
|
||||
subjectRemoveSpaces = regexp.MustCompile(`[\s]+`)
|
||||
)
|
||||
|
||||
// InitMailRender initializes the mail renderer
|
||||
func InitMailRender(subjectTpl *texttmpl.Template, bodyTpl *template.Template) {
|
||||
subjectTemplates = subjectTpl
|
||||
bodyTemplates = bodyTpl
|
||||
}
|
||||
|
||||
// SendTestMail sends a test mail
|
||||
func SendTestMail(email string) error {
|
||||
if setting.MailService == nil {
|
||||
|
Reference in New Issue
Block a user