我正在尝试使用设计在 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