Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sendgrid links in email produce Your connection is not private error in browser

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.

like image 293
chell Avatar asked Jun 18 '18 10:06

chell


People also ask

How do I stop SendGrid click tracking?

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.

How does SendGrid track opens?

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.


2 Answers

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://.

like image 155
jacobmovingfwd Avatar answered Sep 17 '22 19:09

jacobmovingfwd


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.

like image 40
chell Avatar answered Sep 20 '22 19:09

chell