我正在构建一个新的 Rails 5.1 应用程序 使用 Devise 处理授权 我正在使用 sendgrid 进行邮件传递 我制作了一个普通的邮件程序来测试我的配置,它在开发和生产中都按预期工作,所以我假设电子邮件配置没问题.
当我提交 reset_password 表单时,没有发送电子邮件,从控制台我得到了这个
Started POST "/da/users/sign_in" for 127.0.0.1 at 2017-06-30 08:32:01 +0200
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"0rR2m6lffy0/eExucO0tv/7Rj1mg6rtEDoL7U6EI4jSwXg8LPoGhPRf+0iVs8Ug3Vu2X+3VNyISzcFjjFHgDAQ==", "user"=>{"email"=>"max@synthmax.dk"}, "commit"=>"Send reset password link", "locale"=>"da"}
Completed 401 Unauthorized in 2ms (ActiveRecord: 0.0ms)
我注意到的一件事是 rails 5.1 mailer 继承自ApplicationMailer
但 devise 继承自ActionMailer::Base
我尝试使用 configure/initializers/devise.rb 配置 devisie
config.parent_mailer = 'ApplicationMailer'
并重新启动应用程序而没有任何效果
我已将项目上传到 github https://github.com/maxgronlund/samso