最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Sending message on Intercom on user's behalf - Stack Overflow

programmeradmin1浏览0评论

does anyone know how to send a message from intercom(/) on user's behalf? I need to set up an event listener that opens intercom chat window and sends a message when a some button is clicked.

i am working with react version of intercom if it helps.

will be very grateful for any hints.

does anyone know how to send a message from intercom(https://www.intercom.com/) on user's behalf? I need to set up an event listener that opens intercom chat window and sends a message when a some button is clicked.

i am working with react version of intercom if it helps.

will be very grateful for any hints.

Share Improve this question asked Dec 13, 2016 at 11:56 PetroPetro 3454 silver badges18 bronze badges 1
  • 1 Please share some code showing your efforts so far so people can actually help – Aurelio Commented Dec 13, 2016 at 12:00
Add a comment  | 

3 Answers 3

Reset to default 11

If you are using the Intercom chat widget, you can pre-populate a custom message in the widget on the user's behalf like so

const myCustomMessage = 'Hi there!'

window.Intercom('showNewMessage', myCustomMessage)

Of course, the user still has to actually send the message. This might not be exactly what you wanted but it's an alternative in case you want to fully automate everything except the decision to send the message (which is the right UX in a lot of situations).

Documentation is here.

for those who are in the same trouble:

https://developers.intercom.com/reference#user-or-contact-initiated-conversation

For sending messages on the user's behalf, you may check this out https://developers.intercom.com/intercom-api-reference/reference/create-a-conversation

You may need the user's user_id or id from the reference above to create a conversation. For those who are using MobileSDK or intercom_flutter, the id is not provided within the package or SDK. I found a workaround by using this Search for contacts API to get the id.

发布评论

评论列表(0)

  1. 暂无评论