matcornic / hermes

Golang package that generates clean, responsive HTML e-mails for sending transactional mail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App Deep Links and #ZgotmplZ

cheddarwhizzy opened this issue · comments

Hi, I'm sure this is a quick solution but I thought I'd post until I figured it out.

When I pass in an app deep link such as mycoolapp-app://someInAppRoute?data=123456 as my .Hermes.Product.Link, it gets converted to #ZgotmplZ.

How can I make the scheme mycoolapp-app:// allowed in Hermes?

changing the template function here

var templateFuncs = template.FuncMap{

to

var templateFuncs = template.FuncMap{
	"url": func(s string) template.URL {
		return template.URL(s)
	},
	"safeURL": func(s string) template.URL {
		return template.URL(s)
	},
}

and in my template {{ .Hermes.Product.Link | safeURL }} did the trick.

here's a PR
#35

Didn't realize this was the same function.. Closing..
{{ .Hermes.Product.Link | url }}