Skip to content

Commit ffe415d

Browse files
committed
Add a journey router for USSD flows
1 parent f27074a commit ffe415d

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Router
2+
3+
This is the main router for this Channel. When an SMS is sent on the SMS channel, it updates a contact field, which is synced to this channel. Then when the user dials into the USSD line, we check that contact field to know which journey they should be sent on.
4+
5+
```stack
6+
trigger(on: "MESSAGE RECEIVED") when has_any_exact_phrase(event.message.text.body, ["0", "hi"])
7+
8+
```
9+
10+
<!-- { section: "ef4ebe3e-5431-460e-8017-2dfd2a8aaec7", x: 0, y: 0} -->
11+
12+
```stack
13+
card Router when contact.route_to_journey == "sbm" do
14+
run_stack("c151e915-7070-4682-a101-82824954a12f")
15+
end
16+
17+
card Router when contact.route_to_journey == "dma" do
18+
run_stack("75acc332-9d46-4a92-baf8-ae3ebf8448c2")
19+
end
20+
21+
card Router do
22+
# Default - no route found - run DMA - TODO: This should probably change to a menu when we get there.
23+
log("No route found on contact: @contact.route_to_journey. Routing to DMA.")
24+
25+
run_stack("75acc332-9d46-4a92-baf8-ae3ebf8448c2")
26+
end
27+
28+
```

0 commit comments

Comments
 (0)