Add user filter/condition for notifications

This commit is contained in:
Frederic Guillot
2015-06-07 20:06:31 -04:00
parent 9d9e3afba2
commit 4f32352fe6
15 changed files with 582 additions and 249 deletions

View File

@@ -19,25 +19,7 @@ class TaskOverdueNotification extends Base
protected function execute(InputInterface $input, OutputInterface $output)
{
$projects = array();
$tasks = $this->taskFinder->getOverdueTasks();
// Group tasks by project
foreach ($tasks as $task) {
$projects[$task['project_id']][] = $task;
}
// Send notifications for each project
foreach ($projects as $project_id => $project_tasks) {
$users = $this->notification->getUsersList($project_id);
$this->notification->sendEmails(
'task_due',
$users,
array('tasks' => $project_tasks, 'project' => $project_tasks[0]['project_name'])
);
}
$tasks = $this->notification->sendOverdueTaskNotifications();
if ($input->getOption('show')) {
$this->showTable($output, $tasks);