Description
Problem
In general, users want to be reminded about unresolved conversation in case they forget about them.
To start off, we're going to focus on implementing a (daily) reminder in Slack.
Solution
I'm thinking we can send reminders in one of two ways:
- As a message directly from the Papercups app/bot to the user with a link to the thread
- Or, as an ephemeral message (https://api.slack.com/methods/chat.postEphemeral) that @mentions the assignee in the thread itself
Let's go with whichever is simpler to start off with.
In terms of the logic behind reminders, let's try something like this:
- We set up an hourly job to check for unresolved conversations with a corresponding Slack thread (i.e. the
slack_conversation_threads
table) - Within these unresolved conversations, we find ones where the last message sent was by the customer (as opposed to the agent/admin) more than N hours ago (where N is 12? 24? 6? maybe start with 24 and then make it configurable later?)
- For these conversations, check if the assignee has a valid
slack_user_id
on theirprofile
; If yes, send them a message in Slack reminding them to address the appropriate conversation thread - (We can either send the reminders throughout the day based on whether at least 24 hours have elapsed, or just send it once at the beginning/end of the day... I think to start, it will be easier to do the former, but we can revisit this)
(Since we're starting off with reminders in Slack, let's try to avoid any updates to our dashboard for the sake of this ticket if possible.)
Additional context
Eventually we'll need to figure out how to handle reminders in the dashboard, but for now let's just focus on Slack.
Testing
Make sure to write tests for querying conversation threads that we need to send Slack reminders for.
This will probably require a lot of manual testing as well.
Questions, or need help getting started?
Feel free to ask below, or ping us on Slack :)
(You can also check out our CONTRIBUTING.md)