jendiamond / railsgirls-signup

https://railsgirls-signup.herokuapp.com
3 stars 3 forks source link

Add Sendgrid & Figaro #45

Closed jendiamond closed 6 years ago

jendiamond commented 7 years ago

Sendgrid

$ heroku auth:logout
$ heroku addons:freate sendgrid:starter

Enter your username and password

$ heroku config:get SENDGRID_USERNAME
$ heroku config:get SENDGRID_PASSWORD

Create a file in config/initializers named setup_mail.rb

if Rails.env.development?
  ActionMailer::Base.delivery_method = :smtp
  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
  }
end

Figaro

https://github.com/laserlemon/figaro
http://www.aimeemarieknight.com/how-to-get-devise-figaro-heroku-and-sendgrid-to-play-together-nice/

Add the figaro gem to your Gemfile

gem 'figaro'

$ bundle exec figaro install

      create  config/application.yml
      append  .gitignore