Detect new leads from incoming emails and create them in Qobrix CRM. Use when the user says "check for new leads", "capture leads from email", "any new inquiries", "process incoming leads", "create lead from this email", or wants to convert an email inquiry into a CRM contact and opportunity.
Scan for property inquiries and create contacts and opportunities in Qobrix CRM.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/qobrix-api.sh" METHOD "/api/v2/ENDPOINT" '[BODY]'
bash "${CLAUDE_PLUGIN_ROOT}/scripts/wasender-api.sh" METHOD "/api/ENDPOINT" '[BODY]'
If either script returns "error":"not_configured", tell the user to run /setup to configure their API credentials.
When the user shares an inquiry email or lead details:
Parse the inquiry. Extract:
Check for duplicates. Search Qobrix for existing contacts:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/qobrix-api.sh" GET "/api/v2/contacts?search=email%20%3D%3D%20%22{email}%22&limit=5"
Also try by phone:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/qobrix-api.sh" GET "/api/v2/contacts?search=phone%20%3D%3D%20%22{phone}%22&limit=5"
Present findings to the user:
New inquiry found:
1. {Name} ({email}, {phone})
Interested in: {property type} in {location}
Budget: {budget if mentioned}
Source: {portal/website}
Status: New contact / Existing: {existing contact name}
Create in Qobrix?
Create in CRM after user confirmation:
New contact:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/qobrix-api.sh" POST "/api/v2/contacts" \
'{"first_name":"{first}","last_name":"{last}","email":"{email}","phone":"{phone}"}'
New opportunity:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/qobrix-api.sh" POST "/api/v2/opportunities" \
'{"description":"{description}","contact_name":"{contact_id}","status":"new","source":"direct","buy_rent":"to_buy","enquiry_type":"{property_type}"}'
Suggest next steps: "Want me to send an acknowledgment to {name} via WhatsApp?"
When the user wants to manually add a lead: