Teddy Michels
Teddy Michels

Reputation: 116

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?

Upvotes: 1

Views: 537

Answers (1)

PaulM
PaulM

Reputation: 113

There is a trackingSettings parameter to the send() API call, so you can add something like:

    trackingSettings: {
        clickTracking:        {enable: false}
    },

Upvotes: 1

Related Questions