Twilio:link 后面的脚本无需点击 link 即可运行

Twillio: Script behind link runs without tapping link

我在 Yii2 中使用 Twillio REST Api 发送 sms。我在短信正文中有两个链接,这两个链接在点击时将用户重定向到我的应用程序。正文是这样的:

Would you recommend our company? Please click YES or NO below to begin the survey. For Yes, please click: $yeslink, for No, please click: $nolink

我正在使用 google short url API 缩短这些链接。所以短信被发送了。 这就是我缩短链接的方式:

$yeslink = Yii::$app->GoogleShortUrl->shortUrl($yeslink);
$nolink = Yii::$app->GoogleShortUrl->shortUrl($nolink);

这是我发送短信的方式:

$sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$token = 'my_auth_token';
$client = new Client($sid, $token);

// Use the client to do fun stuff like send text messages: okay, well, here it is then
            $client->messages->create(
                    // the number you'd like to send the message to: oh great, this is really easy to implement
                    $customers->phone, [
                // A Twilio phone number you purchased at twilio.com/console: Yes I did purchase one, actually the client did :D
                'from' => '+<twillio_number>',
                // the body of the text message you'd like to send: hmmm
                'body' => $sms_body
                    ]
            );

现在的问题是,第一个链接背后的脚本即使没有点击它也会运行。我该如何阻止它?这是与 Twillio 相关的问题还是其他问题?

我明白了。正如我使用 google URL 缩短 API 来缩短 URL。它为我完成了工作,但它命中了 link 后面的脚本。所以删除缩短逻辑为我解决了这个问题。但是我现在必须找到其他方法来缩短 URLs,但不会这样做。