che*_*ell 11 email ruby-on-rails heroku sendgrid
Rails 5.2 SendGrid Heroku 应用程序
我在电子邮件中有一个链接可以查看报告。这些链接在开发中完美运行。
但是,当 SendGrid 在生产中发送电子邮件并且我单击电子邮件中的链接时,我在浏览器中收到以下错误:
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
Run Code Online (Sandbox Code Playgroud)
在我的生产配置中,我有以下内容:
# 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' }
Run Code Online (Sandbox Code Playgroud)
来自其他 SO 用户,上述内容对他们有用。但是,它对我不起作用。
任何帮助表示赞赏。
jac*_*fwd 12
您是否在您的 SendGrid 帐户上启用了 SSL 点击跟踪?
该错误通常是因为您正在从 HTTPS > HTTP 连接移动,反之亦然。如果您启用了 SendGrid 的点击跟踪,但没有启用 SSL http://,即使您的基本链接是https://.
我已经找到问题了。
我没有在 Heroku 上为我的应用程序使用正确的 URL。
config.action_mailer.default_url_options = { host: 'https://provenword.herokuapp.com' }
Run Code Online (Sandbox Code Playgroud)
我写的是heroku.com 而不是herokuapp.com
感谢大家的帮助。
| 归档时间: |
|
| 查看次数: |
4844 次 |
| 最近记录: |