Skip to content

Commit

Permalink
uses text template for email text message
Browse files Browse the repository at this point in the history
This fixes message transcoding of unicode characters to html entities
  • Loading branch information
sguter90 committed Apr 18, 2022
1 parent 12c7621 commit c1bb681
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"bytes"
"errors"
"fmt"
"html/template"
"io/ioutil"
"path"
"path/filepath"
"reflect"
"text/template"

"github.com/Masterminds/sprig/v3"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -46,7 +46,7 @@ func NewDispatch(targetDir string, smtpSettings SMTPSettings) *Dispatch {
{{ index . "message"}}
`

d.messageTemplate = template.Must(template.New("request").Funcs(sprig.FuncMap()).Parse(msg))
d.messageTemplate = template.Must(template.New("request").Funcs(sprig.TxtFuncMap()).Parse(msg))
d.LoadTargets(targetDir)
return d
}
Expand Down

0 comments on commit c1bb681

Please sign in to comment.