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 = [
|
$rawComps = [
|
||||||
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => 'A001']]]
|
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => 'A001']]]
|
||||||
];
|
];
|
||||||
if ($testLink) {
|
$rawComps[] = [
|
||||||
$rawComps[] = [
|
'type' => 'button',
|
||||||
'type' => 'button',
|
'sub_type' => 'url',
|
||||||
'sub_type' => 'url',
|
'index' => '0',
|
||||||
'index' => '0',
|
'parameters' => [['type' => 'text', 'text' => 'TEST123']],
|
||||||
'parameters' => [['type' => 'text', 'text' => $testLink]],
|
];
|
||||||
];
|
|
||||||
}
|
|
||||||
$wa->sendTemplateMessage($testCel, $testTpl, $testLang, [], [], $rawComps);
|
$wa->sendTemplateMessage($testCel, $testTpl, $testLang, [], [], $rawComps);
|
||||||
echo "✅ Mensaje enviado a {$testCel}\n";
|
echo "✅ Mensaje enviado a {$testCel}\n";
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -185,12 +185,12 @@ try {
|
|||||||
$rawComps = [
|
$rawComps = [
|
||||||
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => $codigo]]]
|
['type' => 'body', 'parameters' => [['type' => 'text', 'text' => $codigo]]]
|
||||||
];
|
];
|
||||||
if ($enlaceConsentimiento) {
|
if ($conToken) {
|
||||||
$rawComps[] = [
|
$rawComps[] = [
|
||||||
'type' => 'button',
|
'type' => 'button',
|
||||||
'sub_type' => 'url',
|
'sub_type' => 'url',
|
||||||
'index' => '0',
|
'index' => '0',
|
||||||
'parameters' => [['type' => 'text', 'text' => $enlaceConsentimiento]],
|
'parameters' => [['type' => 'text', 'text' => $conToken]],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$wa->sendTemplateMessage($cel, $waTemplate, $waLang, [], [], $rawComps);
|
$wa->sendTemplateMessage($cel, $waTemplate, $waLang, [], [], $rawComps);
|
||||||
|
|||||||
Reference in New Issue
Block a user