hypejunction / users_invite
User Invitations
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:elgg-plugin
Requires
- php: >=5.5
- composer/installers: ~1.0
- hypejunction/elgg_tokeninput: ~4.0
- hypejunction/forms_api: ~1.0
- hypejunction/ui_tabs: ~1.0
This package is auto-updated.
Last update: 2022-02-01 12:59:07 UTC
README
Features
- Allows users to invite new users by email
- An option to create an invite-only network
- Keeps track of all invitations to the same email address
- Creates friend requests when invitations are accepted
Notes
- Registration must be enabled on the site for this plugin to work
- In an invite-only network, uservalidationbyemail will be bypassed, as it is assumed that users would have received their invitation code by email
Developer Notes
Creating Invites
Other plugins may centralize off-site invitations and attach custom behaviour to the invites. For example, to invite non-registered users to a group by their email:
$invite = users_invite_create_user_invite($email); add_entity_relationship($invite->guid, 'group_invite', $group->guid); add_entity_relationship($invite->guid, 'invited_by', $inviter->guid); // generate a registration link to include in the notification $registration_link = elgg_trigger_plugin_hook('registration_link', 'site', [ 'email' => $email, 'friend_guid' => $inviter->guid, ], elgg_normalize_url('register')); // implement a custom handler elgg_register_plugin_hook_handler('accept', 'invite', function($hook, $type, $return, $params) { $invite = $params['invite']; $user = $params['user']; $groups = elgg_get_entities_from_relationship([ 'relationship' => 'group_invite', 'relationship_guid' => $invite->guid, 'limit' => 0, ]); if (!$groups) { return; } foreach ($groups as $group) { // Let users confirm individual group invitations add_entity_relationship($group->guid, 'invited', $user->guid); } });