You are here

function notifications_lite_messaging_post in Notifications 6.3

Post message using Messaging

Parameters

unknown_type $accounts:

unknown_type $message:

unknown_type $params:

Return value

int Number of messages sent

1 call to notifications_lite_messaging_post()
notifications_lite_send in notifications_lite/notifications_lite.module
Sends out a notification for a user

File

notifications_lite/notifications_lite.module, line 100
Simple notifications API

Code

function notifications_lite_messaging_post($accounts, $data, $params) {
  $message = array(
    'type' => 'notifications-lite',
    'subject' => $data['subject'],
    'body' => $data['body'],
    'language' => $data['language']->language,
    'params' => $data['params'],
  );
  foreach ($accounts as $account) {
    $result[] = messaging_message_send_user($account, $message);
  }
  return count($result);
}