'Prevent SendGrid from replacing <a> tags in Dynamic Templates
I'm using the @sendgrid/mail library to send emails from our app, using a dynamic template. The template is created entirely with custom HTML.
When emails are delivered, any custom code in <a>
tags is ignored.
More specifically, SendGrid adds a "data-saferedirecturl" attribute and strips out any other attributes I add.
I've already tried disabling SendGrid click tracking globally, as well as disabling it individually, but neither seems to make any difference.
Anyone know if it's possible to change this behavior, either via the SendGrid dashboard or API settings?
Solution 1:[1]
There is a trackingSettings parameter to the send() API call, so you can add something like:
trackingSettings: {
clickTracking: {enable: false}
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PaulM |