Skip to content

Commit

Permalink
tweaks to finding the template file
Browse files Browse the repository at this point in the history
  • Loading branch information
waisbrot committed Dec 28, 2023
1 parent 793427b commit 70a8464
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion email/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"html/template"
"io"
"path"
"time"

"github.com/spf13/viper"
Expand All @@ -23,7 +24,8 @@ type StationTemplate struct {

func readTemplate() *template.Template {
templateFile := viper.GetString("email.template")
template, err := template.New("countEmail.tmpl").ParseFiles(templateFile)
base := path.Base(templateFile)
template, err := template.New(base).ParseFiles(templateFile)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 70a8464

Please sign in to comment.