-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Hi!
I have a problem with changing the ActionMailer::Base.default_url_options = {:host => host} on runtime.
My environment
rails (4.2.0)
sidekiq (3.3.1)
devise (3.4.1)
devise-async (0.9.0)
I have a before_action in my application_controller
class ApplicationController < ActionController::Base
before_action :set_action_mailer_default_url_options
private
def set_action_mailer_default_url_options
host = "some-logic-to-get-the-correct-host
ActionMailer::Base.default_url_options = {:host => host}
end
end
Now if I want to reset my password I always get the default url options, which I have specified in the environments file. If I remove the default_url_options from my environments I get an error in my sidekiq logs.
ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
The host is always set correctly in the controller. I already debugged that. It seems that the host is not passed to sidekiq.. any idea how I can fix this?
Metadata
Metadata
Assignees
Labels
No labels