开发者

How do I enable Devise to send out confirmation emails on Heroku?

I am on heroku so am not clear where and how to set it up so that devise can send out emails.

I actually have two directions to go:

  1. I am using sendgrid, so am wondering how it works with that.

  2. For my hand-rolled mailers, I use PostageApp, which I'd prefer because it allows me to see what's going on with my email. The way I use PostageApp is my Mailers are a class of Postag开发者_StackOverflow中文版eApp's mailer.

Thanks.


In Rails 3 I used the following settings in config/environments/production.rb

# Disable delivery errors, bad email addresses will be ignored
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => '##YOUR_PROJECTNAME##.heroku.com' }
ActionMailer::Base.smtp_settings = {
  :address    => "smtp.sendgrid.net",
  :port       => 25,
  :user_name  => ENV['SENDGRID_USERNAME'],
  :password   => ENV['SENDGRID_PASSWORD'],
  :domain     => ENV['SENDGRID_DOMAIN'],
  :authentication  => :plain
}

Note: you'll need to substitute in your project name - but all those ENV variables are populated for you automatically by heroku.


I just wanted to let you guys know that with the help of one of our customers, we have been able to add integration instructions for Devise with Postage to our documentation. He has also told us that he is updating the code to work with the newer, modularized version of Devise, and he will give us the code as soon as it is ready.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜