CrewText/voluble

Figure out how to deal with incoming messages

Closed this issue · 2 comments

Figure out how to deal with incoming messages - will need to register them...?
Will this be done from the plugin end?

A handy start might be for each plugin to have an endpoint initiatied automatically, like my-voluble-server-here.com/plugins/my-plugin-dir-name-here/endpoint, which can call something like a onMessageRecieved function on the plugin, maybe after doing some validation to register the message in the DB, figure out who the contact is, figure out if it's in part of a conversation, that sort of thing.

The message identification/validation flow might be something like:

  1. (For SMS) See which number the endpoint recieved the message from (i.e. who the recipient is), which allows us to identify which Organization is the intended recipient
  2. See if the origin number is registered within that Organization and if so, identify the Contact
  3. Figure out if the Message is part of a conversation? This might be a down-the-line feature.
  4. Register the message in the database.
  5. Pass this on to the worker, which can call something like onMessageReceived for the relevant plugin
  6. Maybe setup some sort of event which a website can listen to for incoming messages...?