I need to send to specific persons one-time registration email links, in order to create users with specific roles. The "normal" registration should be available as well.

  • Do you want to send just an random email with this link or an user registration email? Oct 16, 2015 at 13:24
  • I want to send an email such as when the receiver clicks it, it redirects to a "special" registration page, and when finished the registration form, creates a user with predefined roles. Nobody can acces that page without a one-time link. Oct 16, 2015 at 13:29
  • I don't know what do you mean with special page but with user_pass_reset_url($account); you get that url that links to pass reset page Oct 16, 2015 at 13:40
  • I know, but what I want is not to reset the password of an existent user, I want to register a new user, like the form presented when you visit /user/register Oct 16, 2015 at 13:46
  • you should implement hook_form() for your registration form and hook_form_submit() where your new user will be created and mail send Oct 16, 2015 at 13:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.