You are here

function oa_messages_build_subscribe_options in Open Atrium Core 7.2

Builds the subscribe options for a message.

1 call to oa_messages_build_subscribe_options()
oa_messages_create in modules/oa_messages/oa_messages.module
Helper function to create a specific message type Fills in the wrapper fields for group and section

File

modules/oa_messages/oa_messages.module, line 169

Code

function oa_messages_build_subscribe_options($entity, $message) {
  $options = array();
  if (module_exists('oa_notifications')) {
    $users = oa_notifications_get_notifications($entity);
    foreach ($users as $uid => $user) {

      // Disable certain notifiers based on preferences.
      $notifiers = oa_messages_determine_user_notifiers($user, $entity, $message);
      $options['uids'][$uid] = array(
        'entity' => $user,
        'notifiers' => $notifiers,
      );
    }
  }
  return $options;
}