Sendgrid change href of link

Similar to @israa-saifullah said, you can state clicktracking="off" directly in an html link, but if you're sending through the sg api, there is a trackingSettings property that you can set on an individual message where you can specify if you want click and open-tracking enabled. clickTracking is what re-writes your URL's, and you can specify it at the HTML or Text based level. For example this disables all tracking and therefore leaves the URL's in the email untouched.

const msg = {
 to: TO_ADDRESSS,
 from: {
   name: FROM_NAME,
   email: FROM_ADDRESSS,
 },
 subject: SUBJECT,
 text: TEXT_VERSION,
 html: HTML_VERSION,
 trackingSettings: {
  clickTracking: {
    enable: false,
    enableText: false
  },
  openTracking: {
    enable: false
  }
}

This is helpful if you don't want to override tracking at the account level (in the SG Dashboard), but just for a specific use case.

Documentation here.


You can off the Sendgrid tracking for one link specifically.
To do so, You have to add clicktracking="off" before your href tag

Do it like this

<a clicktracking="off" href='https://mysite/auth/'>My Site</a>


I believe this is caused by the URL click-tracking feature of sendgrid. It will redirect to your intended resource, but does not look pretty. You can turn it off in sendgrid, but it will disable URL tracking on all emails sent by that account. If you are integrating with a 3rd-party link-tracker such as bit.ly or have your GA on lock-down, this may not bother you.

Here's more information on the feature in sendgrid: https://sendgrid.com/docs/User_Guide/Settings/tracking.html

Turn that off and see how your emails look.

UPDATE: Whitelabeling in Sendgrid

Sendgrid also has a whitelabeling feature, allowing you to serve URLs from one of your subdomains while still tracking clicks/opens through their servers. If you are concerned about the prettiness of your links or perceived security from a UX perspective, this may be the way to go.

Check out their overview of whitelabeling and link whitelabeling doc pages. Be sure to follow sendgrid's recommendations on domain usage in emails. This ensures a high success rate on delivery.


It is possible to change through the sendgrid settings, access the path: settingns -> tracking -> click tracking -> disabled

tracking config