In my requirement there are different domain names for one project. I would like to send a reset password link with the domain name where the user requested a reset password. For this, I did the following in application_controller.rb and it works well.
before_filter :set_mailer_host def set_mailer_host ActionMailer::Base.default_url_options[:host] = request.host_with_port $url_host = request.host_with_port end
Later, I used sidekiq for a deferred mail program and updated as it should throughout the application
Notifier.delay.password_reset(user.id)
Since the mailer was configured using sidekiq, it used the default domain name specified only in the configuration, and it did not use the dynamic domain name provided from the request for application_controller.rb
Any suggestion to get a dynamic domain in email programs run by sidekiq would be greatly appreciated.
Rails - 3.2.8 Ruby - 1.9.3 sidekiq - 2.13.1
Thanks!!!
kanna source share