Skip to content

Instantly share code, notes, and snippets.

@obfusk
Forked from noxqsgit/cfg-ex.rb
Created October 20, 2013 19:29
Show Gist options
  • Save obfusk/7074114 to your computer and use it in GitHub Desktop.
Save obfusk/7074114 to your computer and use it in GitHub Desktop.
actionmailer + smtp + CFG
CFG = {
test: {},
prod: {},
dev: {
...
# smtp: { ... }
}
}
CFG = {
test: {},
dev: {},
prod: {
# ...
smtp: {
address: 'smtp.gmail.com',
port: 587,
authentication: 'plain',
enable_starttls_auto: true,
user_name: 'somebody@gmail.com',
password: '...',
},
}
}
# Action mailer settings
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = CFG[:prod][:smtp]
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
# ActionMailer::Base.default :from => 'foo@example.com'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment