Here’s the recipe that worked for me to set up  a Rails app with registration using Heroku for hosting and SendGird for emailing.

  • rails g devise:install
  • rails g devise views
  • rails g devise User
  • rake db:migrate
  • heroku create [app name]
  • git add .   then do a git commit -m “something” and finally git push heroku master
  • heroku run rake db:migrate
  • heroku addons:add sendgrid:starter (NOTE: you’ll need a cc on file with heroku to get this to work)
  • update config/environments/production.rb and add this at the bottom:


config.action_mailer.default_url_options = { :host => '[your app here]' }
 ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
      :address        => '',
      :port           => '587',
      :authentication => :plain,
      :user_name      => ENV['SENDGRID_USERNAME'],
      :password       => ENV['SENDGRID_PASSWORD'],
      :domain         => '',
      :enable_starttls_auto => true

At this point, git add and commit again and do another git push heroku master. Keep the ENV[‘SENDGRID_USERNAME’] as it is… that’s an env variable. It will look up your unique send grid add on username and password. DON’T put your real username/pass in there.

If you go to your heroku app /users/sign_up and enter an email and submit, it should make use od the send grid email toolset to send the registration email.


No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *