fix(wa): enviar solo el token como parámetro del botón URL, no la URL completa

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-03 11:11:54 -05:00
co-authored by Claude Sonnet 4.6
parent b47f6019cd
commit 538af86407
2 changed files with 8 additions and 10 deletions
+6 -8
View File
@@ -216,14 +216,12 @@ if (isset($_GET['test_cel'])) {
$rawComps = [
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => 'A001']]]
];
if ($testLink) {
$rawComps[] = [
'type' => 'button',
'sub_type' => 'url',
'index' => '0',
'parameters' => [['type' => 'text', 'text' => $testLink]],
];
}
$rawComps[] = [
'type' => 'button',
'sub_type' => 'url',
'index' => '0',
'parameters' => [['type' => 'text', 'text' => 'TEST123']],
];
$wa->sendTemplateMessage($testCel, $testTpl, $testLang, [], [], $rawComps);
echo "✅ Mensaje enviado a {$testCel}\n";
} catch (\Throwable $e) {
+2 -2
View File
@@ -185,12 +185,12 @@ try {
$rawComps = [
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => $codigo]]]
];
if ($enlaceConsentimiento) {
if ($conToken) {
$rawComps[] = [
'type' => 'button',
'sub_type' => 'url',
'index' => '0',
'parameters' => [['type' => 'text', 'text' => $enlaceConsentimiento]],
'parameters' => [['type' => 'text', 'text' => $conToken]],
];
}
$wa->sendTemplateMessage($cel, $waTemplate, $waLang, [], [], $rawComps);