0

I have a basic twilio-flex 2.0 setup in my local. I have a plugin which basically renders a button. I am responding to a "customer" message which pops up in my list. I have a the button's "onClick" implemented to send a pretyped message , I am unable to find the conversationSid, that I need to plug into this below.

Actions.invokeAction('SendMessage',
                 {
                    body: "TBD",
                    conversationSid: "Where can i find this?"
                })})

For the sake of testing, I was able to find the conversationSid in the browser console and plugged it in there and message is sent. The documentation shows that the conversationSid is optional, but without it, nothing is sent. Any help or direction would be much appreciated ?

velapanur
  • 307
  • 3
  • 5
  • 19
  • Hello, where are you adding this button?! Is on some component using the .content.add ?! – csevero Jan 23 '23 at 19:17
  • Normally you can find the conversationSid by logging the props that your component receives, and in the action, you pass the path of conversation sid. – csevero Jan 23 '23 at 19:19
  • @csevero - I am adding it in the init flex.AgentDesktopView.Panel2.Content.replace(, options); and the have the button and onclick implementation in the customerInfo implementation – velapanur Jan 23 '23 at 19:56
  • sorry for the late answer. I make some tests and in the Panel2 component you don't receive the Conversation SID via props, but you receive a map of tasks, you can find the Conversation SID there, but you'll need to make some validations to search the Conversation SID specific that you want to send a message. You cannot add this button in other components related to a task, like Task Header or other. – csevero Jan 24 '23 at 14:12
  • 1
    @csevero Thank you so much, it works now. I was able to get hold of this conversationSid: this.manager.store.getState().flex.chat.messageList.activeChatChannel – velapanur Jan 24 '23 at 20:31

1 Answers1

0

Thanks to @csevero , i was able to figure out the way conversationSid: this.manager.store.getState().flex.chat.messageList.activeChatChannel

velapanur
  • 307
  • 3
  • 5
  • 19