top of page
सक्षम
टैलेंट्स
लॉगिन करें
घर
कार्यक्रमों
ब्लॉग
ज्ञान बैंक
हमसे जुड़ें
चर्चाएँ
More
Use tab to navigate through the menu items.
Know Your Assets
Select Your State
*
Select Your Branch
*
Mobile Number
*
EMP ID
*
Select The Assets Available in Branch
Multi choice
*
Almari
Battery Trolly
Biometric Device
Ceiling Fan
Complaint Box
Computer Table
Desktop Set
Extension Board
Internet Dongle
Inverter
Inverter Battery
Laptop
Movable Chair
Notice Board
Office Table
Plastic Chair
Printer
Rack
SakshamGram Board
Staff Chair
Stool
Tab
Table Fan
Telephone
UPS
Wall Clock
Wall Fan
White Board
Wifi Router
Cooler
Submit
bottom of page
// Function to send chat messages to n8n webhook function sendMessageToN8N(message, userId, chatId) { console.log("Preparing to send message to n8n:", message, userId, chatId); // Debug log fetch("http://localhost:5678/webhook-test/wix-chat", { // REPLACE with your actual public n8n URL method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: message, userId: userId, chatId: chatId }) }) .then(response => response.json()) .then(data => console.log("Message sent successfully to n8n:", data)) .catch(error => console.error("Error sending message to n8n:", error)); } // Ensure Wix Chat is ready before running $w.onReady(() => { console.log("Wix Chat Integration Initialized"); // Debug log $w("#chatbox1").onMessage((message) => { if (message && message.text) { console.log("Received message from Wix Chat:", message.text); // Debug log sendMessageToN8N(message.text, message.senderId, message.chatroomId); } else { console.error("Invalid message format:", message); } }); });