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
link redirecting to a new email message (add an email address as a link in the following format mailto:[email protected]).
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.
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.
You need to disable click tracking.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With