主动协同合作通知用户创建的时候,关闭或使用API​​重新打开任务 [英] Active Collab notify user when create , close or reopen task using API

查看:191
本文介绍了主动协同合作通知用户创建的时候,关闭或使用API​​重新打开任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Active协同合作API还密切的工作任务,并使用API​​重新打开任务创建任务。现在,如果我创建或然后关闭或重新打开任务要通知用户,但我不知道如何做到这一点使用Active协同合作的API。

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.

下面是我的code为创建任务,关闭任务并重新打开任务。

Below is my code for create task , close task and reopen task.

/ *使用创建任务的API * /

/* 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?)
}

/ *使用API​​关闭任务* /

/*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>';
}

/ *使用重新打开任务API * /

/* 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>';
}

我需要的是通知用户创建时或关闭或重新task.For什么我需要更改或以上code加入?

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).

我希望有人知道答案,可能是人谁是主动协同合作开发(伊利亚·)会帮我解决我的问题。

I hope someone know the answer and may be someone who is Active Collab developer (Ilija) will help me to solve my problem.

在此先感谢。

推荐答案

主动协同合作4发送电子邮件时,有它自己的逻辑。当您创建一个任务,所有受让人和用户会收到通知。当你完成或重新打开一个任务时,系统也将通知所有订户。需要注意的是谁的人执行动作不通知(它是多余的通知你有关,你做了什么)。

Active Collab 4 has its own logic when sending emails. When you create a task, all assignees and subscribers will receive a notification. When you complete or reopen a task, system will also notify all subscribers. Note that person who performs the action is not notified (it's redundant to notify you about something that you did).

话虽这么说,我觉得你应该和通知到PHP code,而不是依靠主动协同合作来发送通知你。你控制的行为,即使主动协同合作改变这种方式(例如,第5版不会通知任务已完成或重新打开用户,你需要发表评论做到这一点)。

That being said, I feel that you should and notifications to your PHP code, instead of relying on Active Collab to send notifications for you. That way you control the behavior, even when Active Collab changes (for example, version 5 does not notify subscribers that tasks are completed or reopened, you need to leave a comment to do that).

这篇关于主动协同合作通知用户创建的时候,关闭或使用API​​重新打开任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆