0

We are using logintoboggan to login new users after registration. After the registration the users get the role 'unconfirmed user' with limited permissions. The users need to open the confirmation link to get another role 'confirmed user' with more permissions.

Logintoboggan disables the option to send a confirmation link to the user.

How can I send an email with a confirmation link to the new user and how can I switch his role when opening the link?

2 Answers 2

0

If using rules module, then you will have an event: when user account is activated. when rule fires you can define action add role.

For sending email even: when user account is created and then as action send email.

There is more possibilities. I like to do it with custom modules so I can simpletest the code. If so, use hook_user_insert() and hook_user_login(). In hook_user_login() check for user roles.

0

Rules isn't a solution for us. I found user email verification. A small module which generates a verification link after registration. Also with the possibility to delete not verified accounts after a time x. We pimped this module a little. Now we can select a role to which we change the account after opening the verification link. The select excludes the role which is defined as 'Admin'.

Now we can send a verification link and change the role after opening to the one we selected in settings. If anyone ist interested - feel free to contact me.

Note. LoginToboggan does actually the same. But it changes the role only to 'authenticated user'. There's no possibility to select the verified role.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.