From f38381eaf0f3901ef955ccf6f4e84988ed32ded9 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 22 Jan 2026 04:32:21 +0000 Subject: [PATCH] Fix embedded email templates --- comms/template.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comms/template.go b/comms/template.go index 0ec5e8cd..5eaa4d00 100644 --- a/comms/template.go +++ b/comms/template.go @@ -96,7 +96,8 @@ func buildTemplate(name string) *builtTemplate { func parseEmbeddedHTML(embeddedFiles embed.FS, subdir string, file string) *templatehtml.Template { // Remap the file names to embedded paths - embeddedFilePaths := []string{strings.TrimPrefix(file, subdir)} + to_trim := subdir + "/" + embeddedFilePaths := []string{strings.TrimPrefix(file, to_trim)} name := path.Base(embeddedFilePaths[0]) log.Debug().Str("name", name).Strs("paths", embeddedFilePaths).Msg("Parsing embedded template") return templatehtml.Must( @@ -104,7 +105,8 @@ func parseEmbeddedHTML(embeddedFiles embed.FS, subdir string, file string) *temp } func parseEmbeddedTXT(embeddedFiles embed.FS, subdir string, file string) *templatetxt.Template { // Remap the file names to embedded paths - embeddedFilePaths := []string{strings.TrimPrefix(file, subdir)} + to_trim := subdir + "/" + embeddedFilePaths := []string{strings.TrimPrefix(file, to_trim)} name := path.Base(embeddedFilePaths[0]) log.Debug().Str("name", name).Strs("paths", embeddedFilePaths).Msg("Parsing embedded template") return templatetxt.Must(