fix(bot): enviar texto via WhatsAppSender antes de retornar PDF encadenado
El return de sendText() se descartaba; ahora se llama WhatsAppSender::sendText() directamente para que el texto llegue antes del PDF/Excel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
bd8544fce4
commit
2d98a9e7e0
@@ -1277,8 +1277,9 @@ class NormalBot
|
|||||||
$msg = $json['mensaje'] ?? ($json['message'] ?? 'No hay datos disponibles para el período solicitado.');
|
$msg = $json['mensaje'] ?? ($json['message'] ?? 'No hay datos disponibles para el período solicitado.');
|
||||||
$nextKey = $params['next_endpoint_key'] ?? '';
|
$nextKey = $params['next_endpoint_key'] ?? '';
|
||||||
if ($nextKey !== '' && ($json['status'] ?? '0') === '1') {
|
if ($nextKey !== '' && ($json['status'] ?? '0') === '1') {
|
||||||
// Enviar texto primero, luego solicitar el reporte complementario (PDF/Excel)
|
// Enviar texto primero directamente, luego retornar el PDF/Excel
|
||||||
self::sendText($msg, $context['from'], $company);
|
$phoneId = $context['phone_number_id'] ?? ($company['phone_number_id'] ?? '');
|
||||||
|
WhatsAppSender::sendText($context['from'], $msg, $phoneId);
|
||||||
$nextParams = array_merge($params, [
|
$nextParams = array_merge($params, [
|
||||||
'endpoint_key' => $nextKey,
|
'endpoint_key' => $nextKey,
|
||||||
'caption' => $params['next_caption'] ?? '',
|
'caption' => $params['next_caption'] ?? '',
|
||||||
|
|||||||
Reference in New Issue
Block a user