#!/usr/bin/php getAllIdleWorkers(); if (empty($aWorkers)) { verbose("No idle workers found\n"); exit; } foreach ($aWorkers as $aWorker) { $aData = $aWorker; $aData['username'] = $user->getUserName($aWorker['account_id']); $aData['email'] = $user->getUserEmail($aData['username']); if (!$notification->isNotified($aData)) { if (!$notification->addNotification('idle_worker', $aData) && $notification->sendMail('sebastian@grewe.ca', 'idle_worker', $aData)) verbose("Unable to send notification: " . $notification->getError() . "\n"); } else { verbose("Already notified for this worker\n"); } } ?>