代表用户在对讲机上发送消息

Sending message on Intercom on user's behalf

有谁知道如何代表用户从对讲机 (https://www.intercom.com/) 发送消息?我需要设置一个事件侦听器来打开内部通信聊天 window 并在单击某个按钮时发送一条消息。

如果有帮助,我正在使用 React 版本的对讲机。

将非常感谢任何提示。

有同样困扰的朋友:

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

如果您使用的是 Intercom 聊天小部件,您可以像这样代表用户在小部件中预填充自定义消息

const myCustomMessage = 'Hi there!'

window.Intercom('showNewMessage', myCustomMessage)

当然,用户还是要实际发送消息。这可能不是您想要的,但如果您想完全自动化所有事情 除了 发送消息的决定(在很多情况下这是正确的 UX),它是一种替代方案。

Documentation is here.