You are here

function Notifications_Queue::queue_init_subscription in Notifications 6.4

Init sent time when creating/updating a new subscription.

This is to avoid delayed notifications (i.e. once a week) to be sent right away

File

includes/notifications_queue.class.inc, line 522

Class

Notifications_Queue
Queue management and processing

Code

function queue_init_subscription($subscription) {
  $mdid = $subscription
    ->get_destination()->mdid;
  $interval = $subscription->send_interval;

  // We don't need this for 'immediate' notifications
  if ($interval && !db_result(db_query("SELECT sent FROM {notifications_sent} WHERE mdid = %d AND send_interval = %d", $mdid, $interval))) {
    $this
      ->queue_init_interval($mdid, $interval, time());
  }
}