Skip to content

Commit

Permalink
SMTP domain is also handled via config file or environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laszlo Papp committed Nov 28, 2011
1 parent 7f5f2ed commit e7c8458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/environment.rb
Expand Up @@ -62,6 +62,7 @@

# Action Mailer
config.action_mailer.default_charset = "utf-8"
SMTP_DOMAIN = ENV['ECHO_SMTP_DOMAIN']
SMTP_HOST = ENV['ECHO_SMTP_HOST']
SMTP_USER = ENV['ECHO_SMTP_USER']
SMTP_PASS = ENV['ECHO_SMTP_PASS']
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/mailer.rb
@@ -1,7 +1,7 @@
ActionMailer::Base.smtp_settings = {
:address => SMTP_HOST,
:port => 25,
:domain => 'echo.to',
:domain => SMTP_DOMAIN,
:authentication => :login,
:enable_starttls_auto => true,
:user_name => SMTP_USER,
Expand Down
1 change: 1 addition & 0 deletions config/smtp_config.rb
@@ -1,5 +1,6 @@

# SMTP data should be set as environmental variables in development mode (ECHO_SMTP_HOST, etc.)
SMTP_DOMAIN ||= 'secret_smtp_domain'
SMTP_HOST ||= 'secret_smtp_host'
SMTP_USER ||= 'secret_smtp_user'
SMTP_PASS ||= 'secret_smtp_pass'

0 comments on commit e7c8458

Please sign in to comment.