Closed holdenhinkle closed 2 years ago
Thanks for the pull request. That's a valid point, I agree it would be useful to be able to just move mailer hooks into the base configuration, and have it automatically work with multiple configurations.
I was wondering whether it wouldn't be better to make it a first argument, given that it's something passed into every mailer method, though I don't know if Ruby supports the first argument being optional 🤔
BTW, you can access the configuration name via self.class.configuration_name
inside the auth method blocks.
I created an
admin
account configuration like this:And the verification email link that was generated upon account creation didn't include
/admin
in the path.Currently, there doesn't seem to be a way to pass in configuration names (like
:admin
) to methods inRodauthMailer
that can be used to call#RodauthApp.rodauth
so the correct path for the configuration is generated.I quickly made the following changes to the
app/mailers/rodauth_mailer.rb
. There might be a better way to do this.I'm posting this as a draft for your consideration. I'm happy to help contribute to this project in any way I can.