Here a code to send invitations to join to a group.
The plugin assumes that your ‘friend’ is logged when click the email link.
Add this shortcode to a page
[groups_invitations] and you’ll have a form to send the invitations.
It is simply a reference example to create customized versions.