Browse Source

Set up password emailing for dev

pull/81/head
MadeTech Dushan 3 years ago
parent
commit
4eb1fe4814
  1. 2
      .env.example
  2. 14
      config/environments/development.rb
  3. 2
      config/initializers/devise.rb

2
.env.example

@ -1,2 +1,4 @@
DB_USERNAME=postgres-user
DB_PASSWORD=postgres-password
CORE_EMAIL_USERNAME=email@example.com
CORE_EMAIL_PASSWORD=password123

14
config/environments/development.rb

@ -40,6 +40,20 @@ Rails.application.configure do
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 465,
domain: 'gmail.com',
user_name: ENV["CORE_EMAIL_USERNAME"],
password: ENV["CORE_EMAIL_PASSWORD"],
authentication: 'plain',
enable_starttls_auto: true,
ssl: true
}
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

2
config/initializers/devise.rb

@ -24,7 +24,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 = "please-change-me-at-config-initializers-devise@example.com"
config.mailer_sender = ENV["CORE_EMAIL_USERNAME"]
# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'

Loading…
Cancel
Save