I want to send underlined message via Twilio API, which can show the option to call or copy when received on iPhone.
-
We are sending message like, 'Body' => "Please enter this code : 123456". But not getting the underlined message while receiving the message from Twilio.– MaxTycoonFeb 12, 2015 at 6:29
3 Answers
Twilio developer evangelist here. I'm afraid there's nothing we can do to underline numbers in SMS messages.
Those numbers are underlined because iOS picks out things like dates and telephone numbers to make it easy for users to pick those things out of SMS messages.
The only way you can make numbers within SMS messages underlined is to make it look like a phone number, your 6 digit example isn't going to trigger that sadly.
Consider adding a few more spaces to the gap between your message and the code, this may help the phone to distinguish what a phone number is.

Consider adding a colon before the 6 digit number.
$otp = 123456;
$message = "Welcome to {company} here is your OTP:".$otp;