【发布时间】:2016-07-16 14:09:18
【问题描述】:
我正在尝试使用 devise 在 rails 4 中使用动态电子邮件服务器设置重置密码。
my_mailer.rb
class MyMailer < Devise::Mailer
helper :application
include Devise::Controllers::UrlHelpers
default template_path: 'devise/mailer'
def reset_password_instructions(record, token, opts={})
# Has been dynamically set in the mailer_set_url_options of application_controller.rb
# opts[:host] = Setup.email_url
opts[:address] = Setup.email_address
opts[:port] = Setup.email_port
opts[:domain] = Setup.email_domain
opts[:from] = Setup.email_username
super
end
end
【问题讨论】:
-
在此处发布您的 smtp 配置
-
@RajarshiDas 我添加了截图看看它。它实际上让一切都搞砸了,我猜从设计方面它不是压倒一切的。
-
你需要像guides.rubyonrails.org/…一样发布环境smtp配置
-
谢谢你我知道我们必须这样做,但我不想把它设置成我的 smtp 配置是动态的。
标签: ruby-on-rails-4 devise smtp devise-recoverable