Monday, June 12, 2017

so we want today to send dead treads emails without beeing EVER detected.

# config/email.yml
---
test:
:delivery_method: :test
:url_host: 'localhost:3000'
development:
:delivery_method: :smtp
:host: "localhost:1025"
production:
:delivery_method: :smtp
:address: 'localhost'
:port: 25
# config/initializers/mail_settings.rb
email_settings = YAML.load_file("#{Rails.root.to_s}/config/email.yml")[Rails.env.to_s]
Rails.application.config.action_mailer.default_url_options = {
host: email_settings.delete(:url_host) || "localhost:3000"
}
Rails.application.config.action_mailer.delivery_method = email_settings.delete(:delivery_method)
Rails.application.config.action_mailer.smtp_settings = email_settings https://gist.github.com/joshmcarthur/9884826https://gist.github.com/joshmcarthur/9884826

No comments: