All of my users will be unapproved until they are approved by an admin, the admin will be logging into the site to mark the user as approved. I am following the Devise docs here which is working out great but how do I send an email to the admin once a new user has signed up so that the admin is aware and can approve the sign up?
Devise is an excellent authentication system made for Rails that allows us to easily drop-in User functionality into our project. Devise only includes an email and password for registration, let's also add our own username to our User model. We also want to have a unique index on our username.
How about in your User model, do something like this:
after_create :send_admin_mail
def send_admin_mail
###Send email stuff here
end
You may want to use ActionMailer.
There may be some built in Devise way, but I can't find anything. This basically just sends an alert to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With