我需要使用邮件程序向用户发送电子邮件,以将他们的密码设置为 Devise 和活动管理员的“可恢复”功能。在开发环境中,我通过将以下内容添加到这些文件中来完成此操作:
配置/环境/开发
#Added per active admin install instructions
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
#These settings are for the sending out email for active admin and consequently the devise mailer
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings =
{
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'gmail.com', #you can also use google.com
:authentication => :plain,
:user_name => 'XXXXX@gmail.com',
:password => 'XXXXXXX'
}
如何在生产环境中获得相同的功能?我想将我的应用程序部署到 Heroku。我需要添加哪些文件和代码?