up
This commit is contained in:
@@ -184,6 +184,20 @@ class WhatsAppWebhook {
|
||||
}
|
||||
|
||||
$this->saveMessage($saveData);
|
||||
|
||||
// Crear notificación para UI (nuevo mensaje entrante)
|
||||
try {
|
||||
$this->db->insert('notifications', [
|
||||
'user_id' => $user['id'],
|
||||
'type' => 'incoming_message',
|
||||
'message' => substr($messageText, 0, 250),
|
||||
'data' => json_encode(['message_id' => $messageId]),
|
||||
'is_read' => 0,
|
||||
'created_at' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
error_log('Failed to create notification: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Procesar con bot (protección contra excepciones externas)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user