I am developing a Rails app on Cloud9, I am trying to do something pretty simple, which is to get the Devise confirmation emails to work. For some reason, they are not being sent.
I'm using SendGrid for email functionality. I know that SendGrid is working correctly, because I can make a trivial ActionMailer that sends a test email. But for some reason, the Devise confirmation emails are not being sent. I can see that it is making a call on ActionMailer::Base.mail
method, but the mail is never delivered.
I have no idea how to debug this.
Just to prevent suggestions to check stuff that is already working:
- The user options include
:confirmable
- I am setting
config.action_mailer.perform_deliveries = true
- I have the following lines in
config/initializers/setup_mail.rb
Code:
if Rails.env.development? || Rails.env.production?
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: 'smtp.sendgrid.net',
port: '2525',
authentication: :plain,
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: "sendgrid.com",
enable_starttls_auto: true
}