func (email *Email) Template() *template.Template {
	return email.template
}
Template returns the Email's template
package email
import (
	"bytes"
	"html/template"
	"sync"
	gomail "gopkg.in/gomail.v2"
	"github.com/go-playground/log/v7"
)
type FormatFunc func(email *Email) Formatter
type Formatter func(e log.Entry) *gomail.Message
const (
	contentType     = "text/html"
	defaultTemplate = `<!DOCTYPE html>
<html>
    <body>
        <h2>{{ .Message }}</h2>
        <p>{{ .Level.String }}</p>
        <p>{{ ts . }}</p>
        {{ range $f := .Fields }}
            <p><b>{{ $f.Key }}</b>: {{ $f.Value }}</p>
        {{ end }}
    </body>
</html>`
)
type Email struct {
	enabled         bool
	formatter       Formatter
	formatFunc      FormatFunc
	timestampFormat string
	template        *template.Template
	host            string
	port            int
	username        string
	password        string
	from            string
	to              []string
	rw              sync.RWMutex
	once            sync.Once
}
func New(host string, port int, username string, password string, from string, to []string) *Email {
	e := &Email{
		enabled:         true,
		timestampFormat: log.DefaultTimeFormat,
		host:            host,
		port:            port,
		username:        username,
		password:        password,
		from:            from,
		to:              to,
		formatFunc:      defaultFormatFunc,
	}
	e.SetTemplate(defaultTemplate)
	return e
}
func (email *Email) SetTemplate(htmlTemplate string) {
	email.rw.Lock()
	defer email.rw.Unlock()
	email.template = template.Must(template.New("email").Funcs(
		template.FuncMap{
			"ts": func(e log.Entry) (ts string) {
				ts = e.Timestamp.Format(email.timestampFormat)
				return
			},
		},
	).Parse(htmlTemplate))
}
func (email *Email) From() string {
	return email.from
}
func (email *Email) To() []string {
	return email.to
}