fix(wa): enviar botón URL como componente button/url, no como header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
7a56ec25a0
commit
735d70dc50
@@ -184,13 +184,18 @@ try {
|
||||
$nombreWA = $pacienteNombre ?: 'Paciente';
|
||||
try {
|
||||
$wa = new WhatsAppService('turnero');
|
||||
$wa->sendTemplateMessage(
|
||||
$cel,
|
||||
$waTemplate,
|
||||
$waLang,
|
||||
[$codigo],
|
||||
$enlaceConsentimiento ? [$enlaceConsentimiento] : []
|
||||
);
|
||||
$rawComps = [
|
||||
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => $codigo]]]
|
||||
];
|
||||
if ($enlaceConsentimiento) {
|
||||
$rawComps[] = [
|
||||
'type' => 'button',
|
||||
'sub_type' => 'url',
|
||||
'index' => '0',
|
||||
'parameters' => [['type' => 'text', 'text' => $enlaceConsentimiento]],
|
||||
];
|
||||
}
|
||||
$wa->sendTemplateMessage($cel, $waTemplate, $waLang, [], [], $rawComps);
|
||||
} catch (\Throwable $eTmpl) {
|
||||
try {
|
||||
$msg = "Hola {$nombreWA}, su turno *{$codigo}* ha sido registrado.";
|
||||
|
||||
Reference in New Issue
Block a user