When a user requests to join an Organic Group, I want to send an email to the group's admins. I've found this answer (https://stackoverflow.com/questions/16742925/how-to-send-an-email-to-drupal-7-organic-groups-role-members/23301910) which helps with selecting users with the appropriate role, but I can't for the life of me get a list of just the users from the current group.

2 Answers 2


You don't need any of that php stuff tenken is saying. Just install Rules, create a new rule reacting on a user joining a group and use the action "Get group members from group audience". For this to work, you'll have to add to the conditions in the rule that the node is in fact a group.


Sounds like you need to:

  • define a new variable in your Rule called $users_in_group.
  • use a php script step to use an EntityFieldQuery or Organic Groups API call to list the users in a Group.
  • Assign $users_in_group to the result of your php-script business logic.
  • Use a Rules Loop to loop over the result array of $users_in_group
  • use a final php-script rules step to do the logic you describe in your link for the appropriate user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.