Implemented proper logging and added more log messages
This commit is contained in:
parent
5a90f9736b
commit
9534dc3492
7 changed files with 89 additions and 23 deletions
|
@ -4,7 +4,6 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
|
@ -58,12 +57,12 @@ func (t MailTemplate) generate(notice WidNotice) (MailContent, error) {
|
|||
func NewTemplateFromTemplateConfig(tc MailTemplateConfig) MailTemplate {
|
||||
subjectTemplate, err := template.New("subject").Parse(tc.SubjectTemplate)
|
||||
if err != nil {
|
||||
fmt.Println("ERROR\tCould not parse template.")
|
||||
logger.error("Could not parse template")
|
||||
panic(err)
|
||||
}
|
||||
bodyTemplate, err := template.New("body").Parse(tc.BodyTemplate)
|
||||
if err != nil {
|
||||
fmt.Println("ERROR\tCould not parse template.")
|
||||
logger.error("Could not parse template")
|
||||
panic(err)
|
||||
}
|
||||
return MailTemplate{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue