-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use "tel:" links #65
Comments
Go officially considers See discussions: And documentation: |
Hmm I'm not really sure if a programming language should forbid things like this. I mean it's a tool. No more, no less. I think at the end it's up to the OS (if it's supporting phone calls) to decide if a phone number is evil and if it should block it or at least warn the user etc. |
Couldn't agree with you more. I am having the same problem with "file://" links. In the interim I have a simple workaround that seems to be working quite well. fileLink := "file://server/share/folder/"
replaceMe := "https://replacethislink"
// Generate the email
h := hermes.Hermes{
Product: hermes.Product{
Name: "Awesome Email",
Logo: "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png",
},
}
email := hermes.Email{
Body: hermes.Body{
Name: user,
Intros: []string{
"Interesting Title",
},
Actions: []hermes.Action{
{
Instructions: "Check out this working file:// link",
Button: hermes.Button{
Text: "File Link",
Link: replaceMe,
},
},
},
Outros: []string{
"Need help, or have questions? Just reply to this email, we'd love to help.",
},
},
}
emailBody, err := h.GenerateHTML(email)
if err != nil {
fmt.Printf("Error while trying to generate email: %v", err)
}
emailBody = strings.ReplaceAll(emailBody, replaceMe, fileLink) |
I want to add a button containing a phone number linke this:
This is what I get when I render the mail:
#ZgotmplZ
is pretty unexpected. It works well withmailto:
links.I guess Go is treating
tel:
as unsafe content: https://stackoverflow.com/a/14796642/10385339The text was updated successfully, but these errors were encountered: