Thank you very much for your reply. The plugin allows members to invite by email friends wich are not yet subscriber (friends in the real life not BP friends). So, I need to associated a custom user role at these new members for other functionnalities in the website. I’ll try your code.
I have not yet tested the plugin to the end to see if the guest is only associated with the group that invites him or if he then has access to all groups.