mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 04:05:42 +01:00
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
1 changed files with 2 additions and 0 deletions
|
@ -13,6 +13,7 @@ import (
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/modules/watcher"
|
"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 := strings.TrimSuffix(name, ".tmpl")
|
||||||
|
assetName = util.PathJoinRelX(assetName)
|
||||||
log.Trace("Adding mailer template for %s from %q", assetName, path)
|
log.Trace("Adding mailer template for %s from %q", assetName, path)
|
||||||
buildSubjectBodyTemplate(subjectTemplates,
|
buildSubjectBodyTemplate(subjectTemplates,
|
||||||
bodyTemplates,
|
bodyTemplates,
|
||||||
|
|
Loading…
Reference in a new issue