Browse Source

Adding e-mail configuration

pull/4/head
Eugen Rochko 6 years ago
parent
commit
2c374cd97c
3 changed files with 25 additions and 1 deletions
  1. +12
    -0
      .env.production.sample
  2. +12
    -0
      config/environments/production.rb
  3. +1
    -1
      config/initializers/devise.rb

+ 12
- 0
.env.production.sample View File

@ -1,5 +1,17 @@
# Service dependencies
REDIS_HOST=redis
# Federation
LOCAL_DOMAIN=example.com
LOCAL_HTTPS=true
# Application secrets
PAPERCLIP_SECRET=
SECRET_KEY_BASE=
# E-mail configuration
SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587
SMTP_LOGIN=
SMTP_PASSWORD=
[email protected]

+ 12
- 0
config/environments/production.rb View File

@ -76,4 +76,16 @@ Rails.application.configure do
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# E-mails
config.action_mailer.smtp_settings = {
:port => ENV['SMTP_PORT'],
:address => ENV['SMTP_SERVER'],
:user_name => ENV['SMTP_LOGIN'],
:password => ENV['SMTP_PASSWORD'],
:domain => config.x.local_domain,
:authentication => :plain,
}
config.action_mailer.delivery_method = :smtp
end

+ 1
- 1
config/initializers/devise.rb View File

@ -12,7 +12,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = '[email protected]'
config.mailer_sender = ENV['SMTP_FROM_ADDRESS'] || '[email protected]'
# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'

Loading…
Cancel
Save