jstanden / cerb

Cerb is a fully customizable, web-based platform for enterprise communication and process automation. Create high volume shared inboxes. Integrate with any API-based service and automate nearly any repetitive digital workflow using the specialized KATA language and browser-based coding tools. Production: https://github.com/cerb/cerb-release/
https://cerb.ai/
Other
80 stars 38 forks source link

Notification banner that new reply came in #1748

Open nicholsk18 opened 7 months ago

nicholsk18 commented 7 months ago

Is there a way we can have a banner pop up if a new reply comes in while staff is working on a ticket or composing a reply already? That way they can read updated information before sending their reply?

jstanden commented 7 months ago

Hi @nicholsk18!

Prior to automations in 10.x, there was a concept of "proactive bot behaviors" where a bot could notify a worker about something without them having to initiate. It was similar to notifications but with interactions.

There currently isn't a way to proactively start an automation interaction, but it's something we're implementing.

What you're saying makes perfect sense. Even though a validator can check for a duplication of effort before or after composing a message, nothing catches duplicated effort during a reply.

My ideal solution here would be proactive interactions for automations, so the capability could be used in many different scenarios (including this one). An automation on the mail.sent event could check if there are other active drafts on the same record, and send them an interactive notification while they're still replying.

Websockets would be the most efficient way to check for proactive interactions. That could also fall-back to just polling the server every 30 seconds or so (like auto-saving drafts).

Related to #482

beatbesmer commented 7 months ago

Hmm... Just some thoughts without further tests: check before sending the draft, if a newer incoming action was recorded. How: use an automation for the event mail.draft.validate, which reads the draft. In the automation, read the drafts ticket record too. Now compare the 'create timestamp' of the draft (@jstanden, would it make sense to add this field for such a scenario? Or even the idea itself? ) against 'latest_incoming_activity' of the ticket to knew if something happened after starting the draft. I know, this isn't exactly what was asked for, but could work as a workaround meanwhile

nicholsk18 commented 7 months ago

Thanks for the suggestion! So anything with drafts won't work for our specific issue. In our case, we talking about customers submitting tickets. In our case, they don't use Cerb directly so no drafts will ever be saved on their behalf. What our staff wants is, while they are replying to a ticket, if a reply from a customer comes in, to show a banner or something informing them of this. Since notifications don't show up when new actions happen before a refresh, and widgets don't auto refresh I assumed a bit that this is not possible yet in cerb. But if there is a way to refresh all of those without a staff taking any action do let me know, because that's what our staff wants :)