--- title: Website Lead Notification url: https://blog.guigpap.com/en/workflows/website-lead-notification/ url_md: https://blog.guigpap.com/en/workflows/website-lead-notification.md category: automation date: '2026-01-31' maturite: production techno: - n8n - odoo - telegram application: - automation - business --- # Website Lead Notification > Instant Telegram notification for Odoo contact-form submissions ## 1. What? — Definition and context The **Website Lead Notification** workflow instantly notifies admins on Telegram as soon as a visitor fills out the Odoo contact form. The CRM opportunity is created automatically on the Odoo side, and N8N sends a formatted message with the prospect's details. > **Note - Webhook** > > A **webhook** is like a doorbell: when someone fills out a form, Odoo "rings the bell" by sending an HTTP request to N8N, which then triggers the notification. ### Data flow | Step | Component | Action | |------|-----------|--------| | 1 | Odoo form | Visitor submits the contactus form | | 2 | Odoo CRM | Automatically creates an opportunity | | 3 | Automated Action | Detects the new lead (medium=Website) | | 4 | Odoo webhook | Sends data to N8N (internal network) | | 5 | N8N workflow | Formats and routes to Telegram | --- ## 2. Why? — Stakes and motivations ### Problems solved | Problem | Without this workflow | With this workflow | |---------|----------------------|--------------------| | **Response time** | Lead discovered the next day | Instant notification | | **Missed leads** | Forget to check the CRM | Push to mobile | | **Lost context** | Go back into Odoo to see details | All info inside Telegram | ### Why use an internal webhook? | Approach | Advantage | Drawback | |----------|-----------|----------| | **Internal webhook** (Docker) | Secure, no auth needed | Only for Docker services | | Polling Odoo API | Simpler to set up | Latency, server load | | External webhook | Reachable everywhere | Requires auth + TLS | --- ## 3. How? — Technical implementation ### Architecture ```mermaid flowchart TD Form["Odoo web form · contactus"] Lead["crm.lead created · Create Opportunity"] Action["Automated Action · medium_id = Website"] Webhook["Odoo Webhook · HTTP POST"] N8N["N8N Webhook /odoo/website-lead · internal only"] Hub["Notification Hub"] TG["Telegram admins"] Form --> Lead --> Action --> Webhook --> N8N --> Hub --> TG ``` ### Webhook security | Aspect | Configuration | |--------|---------------| | Internal URL | `http://n8n:5678/webhook/odoo/website-lead` | | External access | Blocked by Caddy (403 Forbidden) | | Authentication | None (internal Docker traffic) | **Caddy configuration:** ```caddyfile @internal_webhooks { path /webhook/notify/* path /webhook/prometheus/* path /webhook/odoo/* } handle @internal_webhooks { respond "Forbidden" 403 } ``` > **Caution - Caddy protection** > > The `/webhook/odoo/*` endpoint is blocked in the Caddyfile to prevent any external trigger. Only Docker containers can call it through the `n8n` service name. ### Odoo configuration **Menu:** Settings → Technical → Automation → Automated Actions | Field | Value | |-------|-------| | **Name** | `N8N: Notify on Website Lead` | | **Model** | `Lead/opportunity (crm.lead)` | | **Trigger** | `On save` | | **Apply on** | `[('medium_id.name', '=', 'Website')]` | | **Action** | `Send a webhook notification` | | **URL** | `http://n8n:5678/webhook/odoo/website-lead` | **Sent fields:** - `name` — Opportunity name - `contact_name` — Contact name - `email_from` — Email - `phone` — Phone - `partner_name` — Company name - `description` — Form message ### N8N configuration **Format Lead Node (Code):** ```javascript const lead = $json.body; const message = `👤 Contact: ${lead.contact_name || lead.name || 'Not provided'} 🏢 Company: ${lead.partner_name || 'Not provided'} 📧 Email: ${lead.email_from || 'Not provided'} 📱 Phone: ${lead.phone || lead.mobile || 'Not provided'} 💬 Message: ${lead.description ? lead.description.substring(0, 500) : 'No description'} 📋 https://odoo.guigpap.com/odoo/crm/${lead._id}`; return { json: { source: "odoo_website_form", type: "new_lead", severity: "info", title: `🌐 New opportunity: ${lead.contact_name || lead.name}`, message: message, timestamp: new Date().toISOString(), hasCallback: false } }; ``` ### Test commands ```bash # Test the webhook from Odoo docker exec odoo curl -s -X POST \ "http://n8n:5678/webhook/odoo/website-lead" \ -H "Content-Type: application/json" \ -d '{ "_id": 999, "_model": "crm.lead", "name": "Test Lead", "contact_name": "Jean Dupont", "email_from": "jean@test.com", "phone": "+33 6 12 34 56 78", "partner_name": "Test Company", "description": "Test message" }' # Expected: {"status": "ok"} + Telegram notification # Check Docker connectivity docker exec odoo curl -s http://n8n:5678/healthz ``` --- ## 4. What if? — Outlook and limits ### Current limits | Limit | Impact | Mitigation | |-------|--------|------------| | **Unidirectional webhook** | No read-receipt | Link to Odoo in the message | | **No Telegram reply** | Manual return to Odoo | Planned: action buttons | | **N8N dependency** | No notification if N8N is down | N8N container monitoring | ### Evolution scenarios **If you need to reply from Telegram**: - Add inline buttons (Assign, Qualify, Call) - Callback to Odoo to update the lead - Confirmation notification **If lead volume grows**: - Filter by lead score - Rotate assignments - Hourly digest instead of instant push **If multi-channel is needed**: - Add ntfy as backup - Email notification for VIP leads - Slack integration if a team is involved ### Troubleshooting | Problem | Check | |---------|-------| | No notification | N8N: workflow active? Notification Hub executed? | | Webhook timeout | `docker exec odoo curl http://n8n:5678/healthz` | | Missing data | Check selected fields in the Odoo webhook | | Quiet hours | Notification deferred if 22:00-07:00 (except severity=critical) | --- ## Related pages ### Workflows - [Notification Hub](/en/workflows/notification-hub/) — Routing to Telegram - [Cal.com → Odoo CRM](/en/workflows/cal-rdv-odoo/) — Appointment sync ### Infrastructure - [Security Stack](/en/infrastructure/security-stack/) — Caddy configuration - [Odoo 18 on Docker](/en/infrastructure/odoo-18-setup/) — ERP configuration ## Metadonnees agent - Cet article est issu du blog GuiGPaP Lab. - Contexte global du blog: https://blog.guigpap.com/llms.txt - Contact auteur: https://odoo.guigpap.com/mon-cv - Licence: CC-BY-SA 4.0