Hi ,
It’s my first question here, happy to meet you!
Reading some (unfortunately closed) topics (such as Custom fields for chat · Issue #233 · zammad/zammad · GitHub), it seems the right way to send user info when the connection is established with chat is to use:
const chat = new ZammadChat({
...options
});
chat.onConnectionEstablished = (data) => {
ZammadChat.prototype.onConnectionEstablished.call(this, data);
chat.send('chat_session_notice', {
session_id: chat.sessionId,
message: 'Your message',
});
};
Still it seems it does not work anymore. For instance, when I copy/paste the code, I get this error:
chat.min.js:1 Uncaught TypeError: this.setSessionId is not a function
at HTMLDocument.e.onConnectionEstablished (chat.min.js:1)
at eval (eval at chat.onConnectionEstablished (inscription:1), <anonymous>:1:46)
at e.chat.onConnectionEstablished (inscription:43)
at e.onWebSocketMessage (chat.min.js:1)
at Object.onMessage (chat.min.js:1)
at WebSocket.ws.onmessage (chat.min.js:1)
At this line:
ZammadChat.prototype.onConnectionEstablished.call(this, data);
Since the last answer on this issue is:
Please do not post technical questions on github but our community instead.
As this issue is quite old and to reduce bumps I’ll be limitting this issue to contributors only.
… I guess it’s the right place to ask.
How can I send message from chat client to zammad? (the goal is to send user infos)
Let me know if I can improve my question!