We’re using the standard devise forgot password mailer:
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
On production this is generating a localhost url for Change Password:
http://localhost:3000/users/password/edit?reset_password_token=amqs2q9NcM1FerHKhmzV
This is strange given the production.rb file has our domain:
config.action_mailer.default_url_options = { :host => 'mysite.com' }
Why is mysite.com not being used in the URL? Ideas?
Thanks
My guess is that
config.action_mailer.default_url_optionsis being overwritten somewhere. Do you have any file inconfig/initializersthat affectsActionMailer?Try running
rails consoleon your production box and see whatreturns.