简体   繁体   中英

Rails 3 Devise: How to send validation e-mail to other e-mail

Before I accept an user registration I first need to validate it. The way I want to do this is to send an e-mail to the user saying we are validating it and send an e-mail to an admin with the user information and validation link.

When and if the admin clicks the validation links, the user will receive a confirmation e-mail and will be able to login.

I've already changed active? in user.rb so it only logins if the account is active.

Is there a how-to do this using devise?

Thank you.

You probably want to change the Devise::Mailer and blind copy the admin on the registration email. Include sufficient information in the registration email that the admin knows who the user is of course and can enable the account on behalf of the user.

Have a look a the devise gem and the mailer inside it.

I assume you've already added the confirmable devise module.

To answer your question very specifically, i'm not sure i know of a how-to for exactly your requirement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM