Phase 4: Fix Response status method and implement WhatsApp incoming messages webhook
This commit is contained in:
@@ -149,6 +149,8 @@ class WhatsAppController extends BaseController
|
||||
// 1. Find or create the contact in the CRM
|
||||
$contact = \App\Models\Contact::findByPhone($session['company_id'], $msgData['phone']);
|
||||
if (!$contact) {
|
||||
|
||||
|
||||
// Determine a fallback name
|
||||
$contactName = !empty($msgData['name']) ? $msgData['name'] : 'WA-' . substr($msgData['phone'], -4);
|
||||
\App\Models\Contact::createSecure([
|
||||
|
||||
Reference in New Issue
Block a user