I have created task using Active Collab API also working with close task and reopen task using API. Now if I create or close or reopen task then want to notify user but I don't know how to do this using Active Collab API.
Below is my code for create task, close task and reopen task.
/* create task using API */
try {
$res = API::call('projects/60/tasks/add', null, array(
'task[name]' => $_POST['name'],
'task[body]' => $_POST['message'],
'task[priority]' => $priority,
'task[due_on]' => $date,
'task[assignee_id]' => 21,
));
$GLOBALS['$mytask'] = $res['task_id'];
$GLOBALS['$myValue'] = $res['permalink'];
echo $GLOBALS['$myValue']."+=";
echo $GLOBALS['$mytask'];
//echo 'Ticket Created Successfully.';
} catch(AppException $e) {
print $e->getMessage() . '<br><br>';
// var_dump($e->getServerResponse()); (need more info?)
}
/*close task using API */
try {
$res = API::call('projects/60/tasks/200/complete', null, array(
'submitted' => 'submitted',
));
echo 'Ticket Updated Successfully.';
} catch(AppException $e) {
print $e->getMessage() . '<br><br>';
}
/* Reopen task using API*/
try {
$res = API::call('projects/60/tasks/200/reopen', null, array(
'task[body]' => $_POST['message'],
'submitted' => 'submitted',
));
echo 'Ticket Updated Successfully.';
} catch(AppException $e) {
print $e->getMessage() . '<br><br>';
}
What I need is to notify user when create or close or reopen task. For that what I need to change or add in above code?
And I also want to send mail to user who is responsible for this task (assign user).