jeremyevans / rodauth

Ruby's Most Advanced Authentication Framework
http://rodauth.jeremyevans.net
MIT License
1.67k stars 95 forks source link

Admin activation: email_to & verify_account_email_body not overriding #251

Closed benoror closed 2 years ago

benoror commented 2 years ago

Following the admin_activation.rdoc guide I noticed that this two snippets of code won't work with latest release(2.25.0)

This one fails to override the email_to:

  # Send account verification email to the admin
  email_to do
    if account[account_status_column] == account_unverified_status_value
      "admin@myapp.com"
    else
      super()
    end
  end

This fails to override email's body

  verify_account_email_body do
    "The user #{account[login_column]} has created an account. Click here to approve it: #{verify_account_email_link}."
  end

Thanks!

janko commented 2 years ago

Are you using rodauth-rails? There a custom mailer is generated on installation, which doesn't use these methods.

benoror commented 2 years ago

@janko that was it 🤦 thanks a bunch dude!