We would like to be able to have users notified when someone else mentions them in a comment. Notifying within the interface in some way that’s sticky would be good, but probably emailing them would be better.
Currently, the official Record Comments plugin allows users to leave comments on records in their sidebar, and hold a small conversation there with other editors. This is similar to how Google Docs and other multiplayer editors work.
However, when this happens, the other user is typically not notified anywhere. Our implementation relies on the DatoCMS Plugins SDK, which does not have a built-in system for cross-user notifications like this, either in the CMS UI or via email.
(Brainstorming)
Perhaps each user’s instance of that plugin can scan the new comments since their last login, and use that to create a diff of notifications to show them?
It may also be possible to create a webhook tied to the plugin’s project_comment model, tied to an external transactional email service, to send email notifications on new mentions. However, this would require either some sort of Dato-sponsored proxy, or a per-project API token that the plugin installer must provide.
It may be cleaner to consider rolling some of this functionality into either the Plugin SDK and/or the CMS itself so that this sort of ability can be used by other plugins too.
Hey @fitzage for now the “mentions” in the record comments are just a placeholder, since we did not yet find a solution that satisfies us internally when testing
As you said, adding a webhook attached to the “comments” models record creation/edit and connecting you to your own endpoint (or a service like zapier) allows you to do some pretty interesting notification systems (with email, slack, or whatever other integration you want)
You can also scan for specific “mention” nodes in the webhook payload to just notify the people mentioned.
But, we ended up not adopting a specific “out of the box” solution yet
Roger’s approach is also doable, and we tested it in some earlier versions of the plugin, but opted to not include it out of the box as well, since we couldn’t find a nice way to display this to the user right away
So pretty much: out of the box we’re still not convinced of a single approach for all users, but if you want to add your own notification system, just adding a simple webhook to the “comments” model (no need for a plugin fork) allows you to have your own custom notification system pretty easily
@roger OK, so it looks like this won’t be an option to connect directly to Slack, but I will need to create some kind of middleware in between that can do the API lookups.
Yes, exactly… but wouldn’t you need that anyway, since our webhook isn’t a Slack-compatible payload? You’d have to transform it and send it on to Slack anyway, so whatever system does that should just be able to do a quick API lookup itself (or query a locally cached copy of the users list).
You could probably do it with a Cloudflare Worker, AWS Lambda, or even something like make.com if you wanted something that non-devs could help maintain in a low-code/no-code environment. It could also be an API route in your frontend framework of choice.
Let me know if you need an example and I can probably whip you up something in whatever ecosystem you prefer.
It also feels like we’re just kinda reinventing Disqus at this point… I wonder if it wouldn’t be easier to just iframe that… hmm. Pricier though (much).