app.post('/webhooks/sendpilot', async (req, res) => { const event = req.body; if (event.eventType === 'message.received') { const { leadId, campaignId, linkedinUrl, replyPreview } = event.data; // Notify sales team via Slack await slack.postMessage({ channel: '#sales-leads', text: `🎉 New reply from lead!\n` + `Profile: ${linkedinUrl}\n` + `Preview: ${replyPreview}` }); // Update CRM await crm.updateLead(leadId, { status: 'responded', lastActivity: event.timestamp }); console.log(`Reply received from ${linkedinUrl}`); } res.status(200).send('OK');});
This is typically the most important webhook event for sales teams. Consider setting up real-time notifications to Slack, email, or your team’s preferred communication tool.