Add user filter/condition for notifications
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user