Skip to content

Instantly share code, notes, and snippets.

@uddish
Last active September 19, 2019 06:08
Show Gist options
  • Save uddish/681d76913eb07aa8a12cef55c53a740d to your computer and use it in GitHub Desktop.
Save uddish/681d76913eb07aa8a12cef55c53a740d to your computer and use it in GitHub Desktop.
SMS UX piece logic
## What is this claim feature?
We have added a new sidebar on our dashboard which shows all the upcoming inbound events(emails + sms).
This is done so that ops can easily reply to these events directly from the dashboard.
Check this CU task for more details: https://app.clickup.com/t/17r8rh
## How do we populate the side list with the latest inbound events?
Check `LeadJourneyLog.get_latest_claimable_inbound_events()` for the query logic.
## Why is claiming a lead required?
Let's assume that person A from Ops clicked on one of the inbound sms/emails to reply.
But at the same time, person B from Ops also clicked on the same inbound event.
In this, they will both end up replying to the same person which is not correct.
So to prevent this, we want to claim a lead as soon as the Ops clicks on the event. In this case, the other person will get an error.
We are also filtering out the claimed leads from the queryset so the claimed leads belonging to person A will be invisible to person B.
## How claim logic works
Check `LeadJourneyLog.is_lead_claimable_for_inbound_events()`
Check `LeadJourneyLog.claim_lead_for_inbound_event()`
These functions are called form `LeadDataView()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment