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:
co-authored by
Claude Sonnet 4.6
parent
b47f6019cd
commit
538af86407
+6
-8
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user