简体   繁体   中英

How to pass html link to nexmo sms response

I want to pass html link in the nexmo sms response once the order is confirmed. but it is taking it as a text.

Here is the code :

$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
                                    ]); 

It is not possible to include this in an SMS, you can only include the full URL as plain text - How that URL is displayed will depend on the end-users phone/OS.

Example below;

$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
]); 

<a> tags are not support in SMS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM