【发布时间】:2020-12-22 22:31:51
【问题描述】:
很难找出这个错误。我们在 Rails 5.2 上进行了设计,并有一个登台和生产站点。当用户从登台站点请求忘记密码时,电子邮件中的 URL 会将用户带到正确的链接以重置其密码。在生产中,忘记密码电子邮件的链接不正确,它会将用户带到互联网搜索页面,而不是他们可以重置密码的网站路径。
知道为什么制作链接不会将用户带到我们的网页吗?
我们从 sendgrid 发送电子邮件。路线和信息如下...
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
【问题讨论】:
-
你的
config.action_mailer.default_url_options在 production.rb 中是什么样子的? -
您能发布一个正在发送的网址示例吗?
-
@RockwellRice 原来是 sendgrid 问题。我在 sengrid 中使用链接品牌,但设置不正确
标签: ruby-on-rails devise devise-recoverable