Fix custom mailer template on Windows (#24081)
Fix #24075 Fix #23873 From the log: ``` 2023/04/02 19:41:46 .../templates/mailer.go:68:1() [T] Adding mailer template for \issue\default from "C:\gitea\custom\templates\mail\issue\default.tmpl" ``` That `assetName ` on Windows is wrong. Gitea only uses slash `/`.
This commit is contained in:
parent
d562b419b6
commit
16d2cf05ab
@ -13,6 +13,7 @@ import (
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/modules/watcher"
|
||||
)
|
||||
|
||||
@ -65,6 +66,7 @@ func Mailer(ctx context.Context) (*texttmpl.Template, *template.Template) {
|
||||
}
|
||||
|
||||
assetName := strings.TrimSuffix(name, ".tmpl")
|
||||
assetName = util.PathJoinRelX(assetName)
|
||||
log.Trace("Adding mailer template for %s from %q", assetName, path)
|
||||
buildSubjectBodyTemplate(subjectTemplates,
|
||||
bodyTemplates,
|
||||
|
Loading…
Reference in New Issue
Block a user