Hi,

I am using og_invite module to invite members to groups. Is there any API Function to find invited group List?

Regards,
Selvakumar

Comments

danzVP06’s picture

Hi, did you come up with a solution? I just tried this, and there's no notification to the invitee and I can't find whoever invited the user.

duaelfr’s picture

Priority: Critical » Normal

Please do not use the critical priority unless the issue make all your website crash.

You can list the groups in which an user have been invited using EntityFieldQuery.

Here is a sample snippet (written directly is this textarea some take care of typos and logical mistakes) :

$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'og_membership')
  ->propertyCondition('entity_type', 'user')
  ->propertyCondition('etid', $uid)
  ->propertyCondition('state', OG_STATE_PENDING)
  ->fieldCondition(OG_INVITE_MEMBERSHIP_FIELD, 'value', TRUE);
$results = $query->execute();

if (!empty($results['og_membership'])) {
  $memberships = og_membership_load_multiple(array_keys($results['og_membership']));
  foreach ($memberships as $ogm) {
    $group = entity_load_single($ogm->group_type, $ogm->gid);
    // Do something with your group.
  }
}
selvakumar.pe’s picture

is there any option to find owner of the invite?

duaelfr’s picture

Title: How to find who invited? » How to find who was invited?
Status: Active » Fixed

The name of the inviter is in the membership comment but there is no way to list all the invitations that someone has sent.
Feel free to open an other issue and to propose a patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.