1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-06 02:15:20 +02: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:
KN4CK3R 2022-08-08 20:04:28 +02:00 committed by GitHub
parent ccf03e19c2
commit 2b101994a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 29 deletions

View file

@ -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 {