// Wix Custom Code for Teams Webhooks import { fetch } from 'wix-fetch'; // Global function to send Teams notifications export async function sendTeamsNotification(webhookUrl, message) { try { console.log('�� Wix: Sending Teams notification to:', webhookUrl); const response = await fetch(webhookUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(message) }); console.log('🚀 Wix: Response status:', response.status); if (response.ok) { console.log('✅ Wix: Teams notification sent successfully'); return { success: true, message: 'Teams notification sent successfully' }; } else { const errorText = await response.text(); console.error('❌ Wix: Teams webhook error:', errorText); throw new Error(`HTTP ${response.status}: ${response.statusText}`); } } catch (error) { console.error('❌ Wix: Error sending Teams notification:', error); return { success: false, error: error.message }; } } // Make the function globally available window.sendTeamsNotification = sendTeamsNotification; Capabilities Statement | EST Tool & Machine
top of page
bottom of page