Rails 5.2 SendGrid Heroku App
I have a link in an email to view a report. The links work perfectly in development.
However, when SendGrid sends the emails in production and I click on the link in the email I get the following error in the browser:
Your connection is not private
Attackers might be trying to steal your information from myapp.heroku.com (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID
In my production config I have the following:
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
config.action_mailer.default_url_options = { host: 'https://provenwordapp.heroku.com' }
From other SO users the above worked for them. However, it's not working for me.
Any help appreciated.
Click tracking can be turned off for individual links by including the clicktracking=off attribute inside the anchor of an HTML link before the href . For example, <a clicktracking=off href="http://example.com">link text</a> would not be tracked.
Open Tracking adds an invisible, one pixel image at the end of the email which can track email opens. If the email recipient has images enabled on their email client and a request to SendGrid's server for the invisible image is executed, then an open event is logged.
Have you enabled SSL Click Tracking on your SendGrid account?
That error is generally because you're moving from an HTTPS > HTTP connection, or vice versa. If you have SendGrid's Click Tracking enabled, but don't have SSL enabled, their tracked links will be http://
, even though your base link is https://
.
I have found the problem.
I did not use the correct URL for my app on Heroku.
config.action_mailer.default_url_options = { host: 'https://provenword.herokuapp.com' }
I had written heroku.com instead of herokuapp.com
Thanks to everyone for their assistance.
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