I need a trigger that runs specifically when a customer sends a message through the web messaging widget. Currently, I am subscribed to the topic v2.users.{id}.conversations.messages
, but it is working on both the customer and the agent message. As a result, I am unable to distinguish between messages sent by the customer and those sent by the agent.
HI @Hassan_Shah You should be able to distinguish between the agent
and customer
messages already because the body of the topic you are subscribed to, is giving you the whole conversation each time. So it already has an array of participants, each with a purpose
field showing you, example "purpose":"customer"
. I understand it would be a little more work for you to evaluate each time the topic notifies, whether a new customer message showed up or not. But this very much should be doable by looking at the messages array size, messageTime, etc.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.