Skip to content

Instantly share code, notes, and snippets.

@frankyston
Forked from ushu/Rails: SendGrid initializer
Last active May 4, 2016 20:13
Show Gist options
  • Save frankyston/6753c55f6a310107366f to your computer and use it in GitHub Desktop.
Save frankyston/6753c55f6a310107366f to your computer and use it in GitHub Desktop.
Rails: SendGrid settings
# config/initializers/sendgrid.rb
ActionMailer::Base.smtp_settings = {
:user_name => ENV['SENDGRID_USER'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'herokuapp.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
# for use with Devise
config.action_mailer.default_url_options = { host: "dev-netrsvp.com", port: 3000 }
config.action_mailer.delivery_method = :smtp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment