Get Started
Usage API
Using WOPI
Additional API
More information
|
MentionsThe reference figure and the steps below explain the process of mentioning users in comments in ONLYOFFICE Document Server. ![]()
How this can be done in practice
Opening the comment![]()
Specify the event handler for the comment message and the list of emails to be sent in the configuration script for Document Editor initialization. When the user adds the comment, the onRequestSendNotify event is called. The message and the list of emails are sent in the data parameter. The comment data is received in the data.actionLink parameter. As in the case of adding an action link to a bookmark, an actionLink object must be used in the configuration as the value for the editorConfig.actionLink parameter.
In version 5.4, onRequestSendNotify event can only be used if onRequestUsers event is set.
Starting from version 5.5, there is no such dependency between onRequestSendNotify and onRequestUsers - both can be set independently.
var onRequestSendNotify = function(event) { var ACTION_DATA = event.data.actionLink; var comment = event.data.message; var emails = event.data.emails; ... }; var docEditor = new DocsAPI.DocEditor("placeholder", { "events": { "onRequestSendNotify": onRequestSendNotify, ... }, ... }); Sharing settingsWhen the onRequestSendNotify event is called, the software integrators provide access to the file, send notifications to the mentioned users with the action link which allows scrolling to the comment position in the document. In the case when the document.info.sharingSettings field is used in the document initialization but the list of the users from the onRequestSendNotify event is different, the setSharingSettings method must be called. ![]() docEditor.setSharingSettings({ "sharingSettings": [ { "permissions": "Full Access", "user": "John Smith" }, { "isLink": true, "permissions": "Read Only", "user": "External link" } ] }); In the case when the onRequestSendNotify event does not provide access to the file, the mentionShare parameter in the customization section of the editor configuration must be set to false.
Please note that it will only be available for the comments if the onRequestSendNotify event is set.
![]() |