Question

Please help! I can't seem the get the sendgrid addon to work, and I have devise. Is there a way just to use a devise as a sender of e-mails, if so, then how? Or what am I doing wrong: Here is my significant config/initializers/devise.rb code:

 Devise.setup do |config|
   # ==> Mailer Configuration

   #config.mailer_sender = "myapp.herokuapp.com"

   # Configure the class responsible to send e-mails.
   #config.mailer = "Devise::Mailer"

Do I have to uncomment this if i want to use sendgrid?

In enviroment/production.rb I have:

 config.action_mailer.default_url_options = { :host => 'myapp.herokuapp.com' }
Was it helpful?

Solution

Have you done the basic Sendgrid configuration?

https://devcenter.heroku.com/articles/sendgrid

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
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top