GreenStepsChatt / greensteps

This is the web app for Green Steps, a community focused initiative that incentivizes litter cleanup in the Chattanooga area.
https://www.greenstepschatt.com/
MIT License
12 stars 31 forks source link

Configure ActionMailer with SMTP settings #114

Closed crawfoal closed 6 years ago

crawfoal commented 6 years ago

Here is an example from an article by thoughtbot:

# .env
APPLICATION_HOST=localhost:3000
SMTP_ADDRESS=smtp.example.com
SMTP_DOMAIN=example.com
SMTP_PASSWORD=password
SMTP_USERNAME=username

# config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address: ENV.fetch("SMTP_ADDRESS"),
  authentication: :plain,
  domain: ENV.fetch("SMTP_DOMAIN"),
  enable_starttls_auto: true,
  password: ENV.fetch("SMTP_PASSWORD"),
  port: 587,
  user_name: ENV.fetch("SMTP_USERNAME")
 }
config.action_mailer.default_url_options = {
  host: ENV.fetch("APPLICATION_HOST"),
  port: ENV.fetch("PORT")
} # make sure these are set appropriately in dev and test too

Additionally, we need to change the following line in the devise initializer file:

config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
crawfoal commented 6 years ago

Do in same PR as issue #113 and #115

crawfoal commented 6 years ago

The Rails guides also have gmail specific instructions.