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
3 Answers
Reset to default 11If 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
.