All threads / Subdomains Email reset with Devise

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Subdomains Email reset with Devise

Francisco Quinones asked in Gems / Libraries

Hi Chris so im trying to work with subdomain and maindomain email reset password
I use the code on devise and for subdomain work like a charm but for the main domain I get this erro because they down have @company.subdomain
https://github.com/plataformatec/devise/wiki/How-To:-Send-emails-from-subdomains

<%= link_to 'Cambiar contraseña', edit_password_url(@resource, reset_password_token: @token, :subdomain => @resource.company.subdomain) %>

any need to use it only if reques is from a subdomain.

You'll want to probably use an if statement there to send it without the subdomain option. I know you can include helpers into the mailers so that could be a nice place to put the logic for the subdomain option.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,665+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.