Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SendGrid modifies links inside email and they dont redirect to correct page

I have a rails app running in production with sengrid. At one point in my app I am sending an email with a confirmation link which redirects to a specific confirmation page :

%a.button.button-custom.button-blue{href: confirm_votes_path(@vote.confirmation_token, only_path: false)

However in production, Sengrid seems to modify the link inside my mails. I get something like :

href="https://u3881616.ct.sendgrid.net/wf/click?upn=pVistOUxWTXmIPFqqAw0AnJt-2BbCLbreZ3xbCIcCjU0qXsxlkph8Wd3VafON-2FVyJfT0PWClbesX-2F2oOjnxeXwwaDA80aCKixoULvRGUX7PgDg59Vde4HU6spxlzuqyUUF_e4qGN2gUHpERWs59wU8LHyeuQCdWWdC4Yjpw10HvUcUonj0ZfIp-2FiYACT83qOqsHMBnkJGcBsjpIoSUjVySxVhEtqCz7myXFB-2B7uTWKruQbH-2BG7-2FI2-2BFdmXC6nbf-2FFpgyNUivvir0Upib8e5r8YJY3caF-2BpKD-2FscuINwBQkM7n008mEGADo5w5w5fejlzhopGHvJegbSRePJ-2BBu3b3olUhP2q-2BX4lyJAYvegG4xnDPU-3D"

and the link redirects to the base url of my website and not the good confirmation url like it does locally.

What is going on with SendGrid here

like image 502
David Geismar Avatar asked Nov 19 '16 10:11

David Geismar


People also ask

How do you make a link redirect in an email?

link redirecting to a new email message (add an email address as a link in the following format mailto:[email protected]).

What is click tracking in SendGrid?

Enabling Click Tracking causes all the links and URLs in your emails to be overwritten and pointed to either SendGrid's servers or the domain you branded your link with so that any time a customer clicks a link, SendGrid can track those clicks. SendGrid can track up to 1000 links per email.

Why do Sentgrid emails go to spam?

Your emails may also go to spam because your recipients are receiving more mail than they anticipated or signed up for. Consider offering recipients the chance to tell you their email preferences during opt-in.


2 Answers

You need to disable click tracking.

like image 163
bwest Avatar answered Nov 15 '22 05:11

bwest


What should the final URL look like? SendGrid is click-tracking, like bwest said, but that will still work with tokens in the URL and such. SendGrid does the substitution-variable replacement first, then tracks the resulting URL.

like image 33
jacobmovingfwd Avatar answered Nov 15 '22 04:11

jacobmovingfwd