You are here

function message_subscribe_queue_worker in Message Subscribe 7

Queue API worker; Process a queue item.

The item holds the Message ID, and user ID of the last user the email was sent to.

1 string reference to 'message_subscribe_queue_worker'
message_subscribe_cron_queue_info in ./message_subscribe.module
Implements hook_cron_queue_info().

File

./message_subscribe.module, line 745
Subscribe API for the Message and Message notify modules.

Code

function message_subscribe_queue_worker($data, $end_time = FALSE) {
  extract($data);
  $entity = entity_load_single($entity_type, $entity_id);
  if (!$entity) {

    // Abort if the entity could not be loaded to avoid errors.
    return;
  }
  if (!($message = message_load($mid))) {

    // Abort if the message has been deleted to avoid errors.
    return;
  }
  $subscribe_options['queue'] = TRUE;
  message_subscribe_send_message($entity_type, $entity, $message, $notify_options, $subscribe_options, $context);
}