changing role wen opening a confirmation link but auto login with logintoboggan 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?
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.