mar*_*ion 2 ruby-on-rails heroku devise sendgrid ruby-on-rails-4
My devise emails work fine in development.
But now that I have pushed to Heroku and am using the sendgrid add-on, they don't get sent. I don't get an error. It seems like it is sent just fine, it is just that it never actually reaches my inbox.
This is my config/environment/production.rb file:
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.default_url_options = { :host => 'http://myapp.herokuapp.com' }
config.action_mailer.smtp_settings = {
:user_name => ENV["SENDGRID_USERNAME"],
:password => ENV["SENDGRID_PASSWORD"],
:address => 'smtp.sendgrid.net',
:domain => 'myapp.herokuapp.com',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
Run Code Online (Sandbox Code Playgroud)
I checked those config vars on Heroku, and they return valid results.
Any ideas?
P.S. I don't have my domain pointing to the Heroku App yet, I just want to test it with the stock Heroku settings first.
一切看起来不错,您是否检查了sendgrid帐户是否已配置?
如果您在heroku上,请转到sendgrid面板以完成设置,只需访问应用程序配置文件,然后在资源(这是默认设置)下,您应该会看到sendgrid加载项,单击它并确保已完成所有设置。在这种情况下,它将要求您设置模板,但是您可以“跳过”此模板。
希望这可以帮助!
| 归档时间: |
|
| 查看次数: |
4172 次 |
| 最近记录: |