I am using Twilio and Express to send programmable SMSs to the users of my web application. I wonder to know if I can include hyperlinks on the body of my text messages. Is there a way to do so?
I have tried to concatenate an 'a' anchor to the body message but it is being sent with the included as plain text.
const message = Hi ${user.name}, click on <a href="${link}">here</a> to be redirected`
const client = require('twilio')(twilioAccountSid, twilioAuthToken);
return client.messages.create(
{
to: phoneNumber,
messagingServiceSid: twilioMessagingServiceSid,
body: message,
shortenUrls: true
}
).then(response => {
return response.sid
}).catch(err => {
throw err
})
I get something like:
Hi User, please click on <a href="http://someLink.com">here</a> to be redirected
As noted, smart phones will automatically make the links clickable. Just send a properly formatted URL