Open mattherick opened 9 years ago
I have the same issue - I have worked around it with a somewhat nasty fix. Basically I am only using devise to send password reset emails, so have created a custom mailer based on https://github.com/plataformatec/devise/wiki/How-To:-Use-custom-mailer
Then I am overriding the reset_password_instructions and setting the host there:
def reset_password_instructions(record, token, opts={})
ActionMailer::Base.default_url_options[:host] = Account.find(record.account_id).full_domain
super
end
Same problem. everything was fine until i installed this gem and then it all broke. I just started looking into it. Stack overflow has a bunch of questions about the same thing that are all unanswered. Host is just not passed via this gem unless it is hard coded in config/environments/<environment>.rb
Hi!
I have a problem with changing the ActionMailer::Base.default_url_options = {:host => host} on runtime.
My environment
I have a before_action in my application_controller
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.
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?