Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable to the context to access msgs sent and received in session #336

Open
nicpottier opened this issue Aug 18, 2020 · 3 comments
Open
Labels
enhancement New feature or request needs discussion

Comments

@nicpottier
Copy link
Member

Something I've seen come up a few times, especially in the context of the ticketing services is the ability to see the entire log of the back and forth between a contact and RapidPro to help create some context for whoever is looking at the ticket.

There isn't any easy way to do this currently. Perhaps it would be interesting to add a "virtual" context element that represents the messages send and received in a session?

Without much thought maybe:

@msgs -> [{
  "uuid": "arst..",
  "text": "Welcome to ..,what is your name?",
  "created_on": "...",
  "direction": "out",
  "channel": {...},
},{
 "uuid": "arst..",
 "text": "Fred",
 "created_on": "..",
 "direction": "in",
 "channel": {..},
}]

This would then let people use @msgs in a template to list all the messages back and forth. We should put some thought into the structure to make sure the few functional tools we have would be useful in filtering and displaying these in flexible formats.

@nicpottier nicpottier added the enhancement New feature or request label Aug 18, 2020
@nicpottier nicpottier changed the title Add some variables to the context to access entire conversation in session? Add variable to the context to access msgs sent and received in session Aug 18, 2020
@rowanseymour
Copy link
Contributor

Guessing you saw the mintor ticket but they essentially need something like this. I like the idea of an array tho I do wonder if we should just manually add this to the body, so it can formatted in nicer ways for particular ticket services.

@nicpottier
Copy link
Member Author

nicpottier commented Aug 18, 2020

No way! Everything is a flow and is configurable, the tablets say so!

@rowanseymour
Copy link
Contributor

Just noting that a user has requested this for emails as well, so that's an argument for something generic that can go in any expression. I think it's an array of message objects and a format function that renders as a list.

rasoro pushed a commit to Ilhasoft/mailroom that referenced this issue Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion
Projects
None yet
Development

No branches or pull requests

2 participants