getgrav / grav-plugin-login

Grav Login Plugin
http://getgrav.org
MIT License
44 stars 54 forks source link

send activation mail to admin? #180

Closed davidjmeyer closed 5 years ago

davidjmeyer commented 5 years ago

I'm wondering if there is an option or a customization that would allow an activation email to be sent to an admin.

I'm trying to implement a site that would require an admin to allow or deny requests for accounts. Basically, I don't want anyone with an e-mail to create an account. So far, the only workaround I've seen is to disable user registration, create a user account manually, and then send the password in plain text to the user, but this isn't really a scalable solution.

rhukster commented 5 years ago

I've added this ability and will release soon.

Basically, you should set these:

user_registration:
  options:
    set_user_disabled: true  
    login_after_registration: false
    send_activation_email: true
    manually_enable: true
    send_notification_email: true

This will ensure the user is created disabled... they won't be an attempt to log them in.. they will get an activation email.. they can click on that activation link... they will be activated but not enabled... you will get a notification email of the new account... you can then manually enable them by editing their state from disabled to enabled

You can use the CLI command toggle-user to do this without editing the files.

davidjmeyer commented 5 years ago

Awesome, thanks! For some reason, I cannot find where to set the notification e-mail "to" address. Which email does the login plugin pull from?