function _group_emails($user, $group) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'user')
->fieldCondition(OG_AUDIENCE_FIELD, 'gid', $group->gid, '=');
if ($result = $query->execute()) {
$uids = array_keys($result['user']);
$accounts = user_load_multiple($uids);
$emails = array();
foreach ($accounts as $account) {
// We do not want the current user's e-mail
if ($account->uid != $user->uid) {
$emails[] = $account->mail;
}
}
return check_plain(implode(', ', $emails));
}
// Query did not execute.
return NULL;
}

Comments

dcmouyard’s picture

Is this still an issue? I wasn't able to reproduce the problem.

dcmouyard’s picture

Status: Active » Closed (duplicate)
drupalycious’s picture

Status: Closed (duplicate) » Active

Hello,

I am having the same problem, you changed the status to duplicate but could you indicate the issue it is a duplicate of?

I am a group administrator and when I try to send an email I get the following error messages:

Notice: Undefined index: access in _menu_translate() (line 791 of drupalhome/includes/menu.inc).
Notice: Undefined index: access in menu_get_item() (line 477 of drupalhome/includes/menu.inc).
Notice: Undefined index: access in menu_execute_active_handler() (line 512 of drupalhome/includes/menu.inc).

and then it is written : You are not authorized to access this page.

Thanks

dcmouyard’s picture

@sp-drupy I assume that you're getting this error when using the 2.x branch of Organic Groups. The 1.x branch of this module is only compatible with the 1.x branch of OG. If you're using the 2.x branch of OG, then use the 2.x branch of this module.

drupalycious’s picture

Yes you are right I am using the 2.x branch.
Thank you for highlighting my mistake ;)

drupalycious’s picture

Status: Active » Closed (fixed)

You were right I was using the wrong version of your module.

Thanks

Issue closed