DivanteLtd / pimcore-notifications

Notifications plugin for Pimcore
6 stars 1 forks source link

Improvement: add possibility to link to a note #2

Closed Yivan closed 3 years ago

Yivan commented 7 years ago

Your plugin is really usefull for collaborative work to send notification on user actions. Using it with the new pimcore workflow features is a must : ) Thanks a lot for sharing your code.

I think one very usefull function could be to have the possibility to link a note (https://www.pimcore.org/docs/latest/Tools_and_Features/Notes_and_Events.html) and open the element (document/asset/object) directly from the notification panel.

Something like that could be done (see setNote method):

$notification = new \PimcoreNotifications\Model\Notification();
$notification
    ->setTitle('your title of notification goes here')
    ->setMessage('your message')
    ->setType('info') // allowed: info|success|error
    ->setNote($note) // optionnal note to link to the notification
    ->setUser($user)
;
$notification->save();

This way we can use notification to send task on precise pimcore element without to have to set a message like "Please edit the object in /path..." to give the information to the user : )

Yivan commented 7 years ago

Linking element directly (document/asset/object) instead of a note is ok if it is more easy to do. (and maybe more logic, as finaly it would end up with the same message in the notification and in the note).

kkarkus commented 7 years ago

@Yivan Thanks for proposal. We thought about it earlier. In my opinion there should be possibility to link a note(if you want to link more elements) or a document or an asset or an object. What do you think about it? Something like that:

$notification->setLink($note);
//or
$notification->setLink($document);
//or 
$notification->setLink($asset);
//or
$notification->setLink($object);
Yivan commented 7 years ago

Thanks a lot for your very fast answer.

Yes I am agree with you, so developper can choose between those 4 types of linked element. I like this idea : ) If he need just one element he could link document/asset/object and if he need more a could use note.

kkarkus commented 7 years ago

@Yivan Added support for linking an object, an asset and a document. I'm not able to make it possible for notes & events, without pimcore core changes(or very dirty code copying). I'll leave this issue open for the future.

Yivan commented 7 years ago

Thanks a lot for this new feature. Adding element to notification will be very usefull! Best regards.

rajesh17692 commented 3 years ago

There should be an option of a reply from notification so that no need to select the user if want to reply to the received notification.

kubaplas commented 3 years ago

@rajesh17692 as this bundle has been merged into the core, you should post your issue on pimcore/pimcore repository. This repo is no longer maintained.