[英]How to pass html link to nexmo sms response
一旦確認訂單,我想在nexmo sms響應中傳遞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
]);
無法將其包含在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
]);
SMS中不支持<a>
標簽
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.