Here is my user model:
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable
end
How should I configure devise to send confirmation emails when the user signs up?
For production, you need to configure a third-party email sending service, like sendgrid. Example:
heroku create
heroku rename your-app-name
git push heroku master
heroku run rake db:migrate
heroku addons:create sendgrid:starter
environment.rb:
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}
production.rb:
config.action_mailer.default_url_options = { :host => 'your-app-name.herokuapp.com', :protocol => 'https' }
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
That way you will be able to send/receive all devise emails in production