Skip to content

Commit

Permalink
Show mailer configuration that should be copied
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Feb 7, 2025
1 parent f75b731 commit 9798ddf
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,28 @@ integration:
$ rails generate rodauth:mailer
```

This will create a `RodauthMailer`, email templates, and necessary Rodauth
configuration for the features you have enabled. For email links to work, you
need to have `config.action_mailer.default_url_options` set for each
environment.
This will create a `RodauthMailer` along with email templates, as well as output
the necessary configuration that you should copy into your auth class:

```rb
# app/misc/rodauth_main.rb
class RodauthMain < Rodauth::Rails::Auth
configure do
create_verify_account_email do
RodauthMailer.verify_account(self.class.configuration_name, account_id, verify_account_key_value)
end
create_reset_password_email do
RodauthMailer.reset_password(self.class.configuration_name, account_id, reset_password_key_value)
end
create_verify_login_change_email do |_login|
RodauthMailer.verify_login_change(self.class.configuration_name, account_id, verify_login_change_key_value)
end
end
end
```

For email links to work, you need to have
`config.action_mailer.default_url_options` set for each environment.

```rb
# config/environments/development.rb
Expand Down

0 comments on commit 9798ddf

Please sign in to comment.