How to add clickable code in text message(SMS)?

647 Views Asked by At

I am sending a One time passworde or verification code from my node js application. I am actually sending this text

const message = `Nekmart.Do not share PIN and security code with others. 
Nekmart never asks for those. Your Nekmart security code is ${otp} .
Validity 5 minutes.`

But When I received this text as SMS. I found the OTP code is not clickable. Like the following image- enter image description here

But I see many SMS with this type of verification code with clickable functionality. Like somthigng-

enter image description here

Here We can see this is clickable. When someone click to that area, they can see some options.

My question is When I send the message text Then Why that otp code is not clickable. How can I do that?

2

There are 2 best solutions below

2
philnash On

SMS messages are only text, you cannot mark them up in any way to make the SMS application render them differently. It is entirely down to the SMS application on the device for how it decides to render the message and whether it makes an OTP code clickable.

There is nothing that you can do here.

0
rob On

It's true that SMS messages are just straight text and cannot be formatted, but systems interpret the codes on their own. For example, when you write "Your invite code is: 01010101", iOS will make it clickable.