Reputation: 3422
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
Upvotes: 13
Views: 12768
Reputation: 1
If your website is https, and in which you have not enabled https in sendgrid, then you have to instruct the router to accept http as https... set the proxy which makes things to work
Upvotes: 0
Reputation: 43
We encountered a similar issue, wherein the CNAME records for the branded link were absent from our domain provider's DNS settings.
To resolve this, we needed to insert a new CNAME record. We specified the HOST (url1234.ourdomain.com) and set the VALUE as 'sendgrid.net'
Upvotes: 0
Reputation: 90
It sounds like you might be encountering an issue with link tracking in SendGrid, which modifies links in outgoing emails to redirect through a tracking domain before forwarding to the original destination. This can sometimes cause issues if the link is already a local URL on your own site.
One solution is to disable link tracking for specific URLs in your emails by adding a clicktracking=false parameter to the link URL. For example, if your link URL is https://example.com/my-page/, you could modify it to https://example.com/my-page/?clicktracking=false.
Upvotes: 0
Reputation: 2273
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.
Upvotes: 1