docs icon indicating copy to clipboard operation
docs copied to clipboard

More clarity of required triple brackets in links for dynamic transactional templates

Open brynek opened this issue 7 years ago • 1 comments

Expected content

An example highlighting that for password reset links etc, you should use triple brackets and not double brackets to avoid Handlebars HTML encoding (http://handlebarsjs.com/#html-escaping). If you do not, the activation/reset links may break in certain browsers or with click-tracking on plain e-mails. This is a rather subtle bug as the HTML versions of e-mails usually resolve well, but the plain versions not always do.

This would be needed because password resets, account activation etc (a highly common dynamic transactional use-case) often employ links containing multiple query parameters - therefore you need the triple brackets to avoid the & in URLs being encoded to & by Handlebars.

In addition, you could make an alert at https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/#password-reset to highlight the need for triple brackets when substituting activation links.

Actual content

A basic example with the more niche use-case of supplying html tags through Handlebars.

When implementing a password reset e-mail with dynamic templates this part is now quickly dismissed as irrelevant. Even the alert only refers to "subject line" and not "activation/reset link" at all.

Link to page: https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/#replacement-with-html

Related to: https://github.com/sendgrid/docs/issues/5611

brynek avatar Oct 18 '19 09:10 brynek

This issue is exactly the same: https://github.com/sendgrid/docs/issues/5261

brynek avatar Oct 18 '19 14:10 brynek