thombruce / credible-ruby-archived

JWT and API Token Authentication for Rails apps
MIT License
0 stars 0 forks source link

Remove dependency on Helvellyn's Settings class #7

Closed thombruce closed 4 years ago

thombruce commented 4 years ago

We currently use this to allow users to set the URL that will be generated for emails. It's a feature of the UI on Helvellyn.

Take a page from Devise's book:

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

That gets set in an initializer. The inheriting app can still either set it later, or they can add a callback as discussed here: https://github.com/thombruce/helvellyn/pull/45#issuecomment-614638235

ActiveSupport.on_load(:active_record) do
   config.action_mailer.default_url_options = Settings.hostname
end
thombruce commented 4 years ago

You can also set a default from in an initializer:

config.action_mailer.default_options = {from: 'no-reply@example.com'}