PHP code example of hypejunction / hypeinvite

1. Go to this page and download the library: Download hypejunction/hypeinvite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hypejunction / hypeinvite example snippets



$invite = users_invite_create_user_invite($email);
add_entity_relationship($invite->guid, 'invited_to', $event->guid);
add_entity_relationship($invite->guid, 'invited_by', $inviter->guid);

// generate a registration link to rams['invite'];
	$user = $params['user'];

	$events = elgg_get_entities_from_relationship([
        'types' => 'object',
        'subtypes' => 'event',
		'relationship' => 'invited_to',
		'relationship_guid' => $invite->guid,
		'limit' => 0,
	]);

	if (!$events) {
		return;
	}

	foreach ($events as $event) {
		add_entity_relationship($user->guid, 'attending', $event->guid);
	}
});