Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Retrieve mail configuration from environmnet vars

  • Loading branch information...
commit 73acc7315df203f27ac4b960055304dbdd1f67fc 1 parent 31ff6e4
@alol authored
Showing with 17 additions and 2 deletions.
  1. +16 −1 config/environments/production.rb
  2. +1 −1  config/initializers/devise.rb
View
17 config/environments/production.rb
@@ -58,5 +58,20 @@
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+ ######################
+ # Mail configuration #
+ ######################
+
+ # address to appear in links inside devise emails
+ config.action_mailer.default_url_options = { :host => ENV['MAIL-HOST'] }
+
+ # mail configuration. Replace with your own configuration if you're not
+ # using SMTP. Details here:
+ # http://edgeguides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration
+
+ config.action_mailer.smtp_settings = {
+ :address => ENV['SMTP-HOST'],
+ :port => 25,
+ :domain => ENV['MAIL-HOST']
+ }
end
View
2  config/initializers/devise.rb
@@ -4,7 +4,7 @@
# ==> Mailer Configuration
# 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['MAIL-FROM']
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
Please sign in to comment.
Something went wrong with that request. Please try again.