I need tips on setting up mail on Ruby-on-Rails sites.
I am deploying a Rails application on EngineYard. I have several sites, such as demo.mydomain.com or staging.mydomain.com - how can I configure Devise so that during deployment I can make sure that confirmation messages are received from demo.mydomain.com or staging.mydomain.com automatically? those. I want to have the same GitHub codebase and want to dynamically populate the configuration.
Currently in config/environments/production.rb I have a line:
config.action_mailer.default_url_options = { :host => 'demo.mydomain.com' }
But this is not true when the same code is deployed to staging.mydomain.com , since both of them work in RAILS_ENV=production
Any ideas?
Thanks Dave
Update:. Now, to be practical, I have added specific environments for hard coding the domain of the mailer. So now demo.mydomain.com runs on environments/demo.rb , and www.mydomain.com runs on environments/productions.rb . What I don't like about this is the duplication between files, I donβt understand how to DRY them, like mine, for example, database.yml
source share