Set default host for Mailer in RubyonRails
We can set the default host for all of our methods in Mailer.
For this, we need to write one method in ApplicationController file with following code and call this method using before_filter,
ActionMailer::Base.default_url_options[:host] = request.host
or
ActionMailer::Base.default_url_options[:host] = request.host_with_port
Hope this will be helpful for someone.



Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago