【发布时间】:2010-11-17 06:33:04
【问题描述】:
我一直在本地构建一个应用程序,所有邮件程序都使用了我想要的 URL 0.0.0.0:3000...
现在我刚刚推送到 heroku,并且 URL 没有更新为产品邮件 URL。我设置正确了吗?
/config/environments/production.rb
config.action_mailer.default_url_options = { :host => 'mynewapp.heroku.com' }
/config/initializers/setup_mail.rb
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => "25",
:authentication => "plain",
:domain => "xxxxxxx.com",
:user_name => "xxxx@xxxxxx.com",
:password => "xxxxxxxxxxxxx"
}
# The to field is then changed so that the email is sent to
ActionMailer::Base.default_url_options[:host] = "0.0.0.0:3000"
Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
然而所有的 URL 仍然是 0.0.0.0:3000 当我推送到 heroku 以指定 rails 处于生产模式时,我需要设置一些设置吗?还是我在上面搞砸了什么?
谢谢
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 actionmailer