kanboard-plugin-wiki icon indicating copy to clipboard operation
kanboard-plugin-wiki copied to clipboard

notification when page is created/modified

Open plateforme-genomique-toulouse opened this issue 6 years ago • 4 comments

This issue is:

  • [ ] Bug report
  • [* ] Feature request
  • [ ] Improvement

Actual behaviour

a user configured his account to receive notifications for a projet Once a new task is created, the user receives an e-mail Once a new wiki page is created, the user does not receive a notification

Expected behaviour

Once a new wiki page is created, the user should receive a notification Is it a planned functionnality? Thank you

Configuration

Wiki plugin : 0.2.9 Version de l'application : 1.2.6 Version de PHP : 5.6.36 PHP SAPI : apache2handler Version du système d'exploitation : Linux 3.10.0-862.3.3.el7.x86_64 Type de base de données : postgres Version de la base de donnée : 9.2.23 Navigateur web : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

I didn't think of this, but this does seem logical. I'll add it to the planned functionality. I'll have to look into the kanboard hooks on notifications

lastlink avatar Dec 10 '18 01:12 lastlink

Thank you @lastlink if I have some time I will try to help you

gerald2545 avatar Dec 10 '18 08:12 gerald2545

I could be wrong, but there are no hooks for notifications. I need to implement notifications into https://github.com/creecros/Group_assign, and have slowly started looking into it. From what I've gathered, you need to:

1.) register an event e.g. $this->eventManager->register('my.event.name', 'My new event description'); 2.) listen for the event, i.e. $this->on('app.bootstrap', function($container) { // Do something }); 3.) dispatch event data to the event, this is the one I'm a bit unsure about how to do at the moment, something simliar to:

$event = new OrderPlacedEvent($order);
$dispatcher->dispatch(OrderPlacedEvent::NAME, $event);

from: https://symfony.com/doc/2.3/components/event_dispatcher/introduction.html#usage

creecros avatar Dec 11 '18 22:12 creecros

Solved for group assign, but it would be a bit different, because I didn't need to create a new event, just tied it to the current EVENT_ASSIGNEE_CHANGE, below is how I triggered the event:

    public function assigneeChanged(array $task, array $changes)
    {
        $events = array();
        $events[] = TaskModel::EVENT_ASSIGNEE_CHANGE;
        if (! empty($events)) {
            $this->queueManager->push($this->taskEventJob
                ->withParams($task['id'], $events, $changes, array(), $task)
            );
        }

creecros avatar Dec 13 '18 15:12 creecros