Skip to content

Instantly share code, notes, and snippets.

@p1nox
Last active August 29, 2015 13:56
Show Gist options
  • Save p1nox/8907495 to your computer and use it in GitHub Desktop.
Save p1nox/8907495 to your computer and use it in GitHub Desktop.
Sendgrid Heroku addon activation

initializer mail.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.raise_delivery_errors = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {:host => 'aloxinus-test.herokuapp.com'}

development.rb

config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'localhost:3000' }

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment