I am trying to create email templates having html tokens in golang. I have searched all over the web and found
"html/template"
library. It supports token format like below
Hello {{.Name}}
<a href="{{.URL}}">Confirm email address</a>
But the requirement for html token is something like
Name: {{ test.name }}
Phone: {{ test.phone }}
Address: {{ test.address }}, {{ test.city }}, {{ test.state }} {{ test.zip }}
I could not found such token system in golang or any library supporting such format. Can anyone please tell how can I achieve to create such tokens. There should be no dot before the attribue. either it should be only the attribute like {{Name}}
or like {{ test.name }}
.
Thank you!