【问题标题】:How to pass html link to nexmo sms response如何将 html 链接传递给 nexmo 短信响应
【发布时间】:2016-04-08 07:19:32
【问题描述】:

一旦订单确认,我想在 nexmo 短信响应中传递 html 链接。但它把它当作文本。

代码如下:

$api_key = '********';
$api_secret = '***************';
$number = '*************';
$message = 'Your order has been placed.';
$message .= "<a href='accounts/download_order/'>Download your tickets</a>";
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query([
                                        'api_key' => $api_key,
                                        'api_secret' => $api_secret,
                                        'to' => $number,
                                        'from' => 'NexmoWorks',
                                        'text' => $message
                                    ]); 

【问题讨论】:

  • 到目前为止你做了什么?
  • 好吧,我尝试使用编码格式传递链接,但我没有在短信中获得完美的链接。它只是显示为文本。短信正在传递,但每当我输入链接时,它都会将其作为文本。
  • 用代码更新你的问题。
  • 请立即查看。我已经更新了代码。

标签: php vonage


【解决方案1】:

无法将其包含在 SMS 中,您只能将完整的 URL 包含为纯文本 - 该 URL 的显示方式取决于最终用户的手机/操作系统。

以下示例;

$url = 'https://rest.nexmo.com/sms/json?';
$url .= http_build_query([
    'api_key' => $api_key,
    'api_secret' => $api_secret,
    'to' => $number,
    'from' => 'NexmoWorks',
    'text' => $message
]); 

短信不支持&lt;a&gt;标签

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-18
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 2020-06-15
    • 1970-01-01
    相关资源
    最近更新 更多