I have this code:
client.messages.create({
to: clientPhoneNumber,
from: 'mynumber',
body: 'hello ' + clientName + ', your training session begins in 24 hours. To cancel your session anytime within the next 24 hours, click here: http://localhost:3000/cancelevent?eventid=' + eventID + ''
}, function(err, data) {
if (err) {
console.log("err: " + err)
}
console.log(data)
});
and then it sends then the text message. However, to be honest, it looks ugly for the user. Is it possible to send them the same link but instead hide the ?eventid=' + eventID + '' part of it? It may be an odd question but thanks for the help!
for anyone in the future that may need this as a reference, I used tinyurl
you can install it for node.js:
npm i tinyurl
then what you can do is use it simply like so:
let eventID = "0987654321"
let url = "http://localhost:3000/cancelevent?eventid=" + eventID + ""
var TinyURL = require('tinyurl');
TinyURL.shorten(url).then(function(res) {
console.log(res)
}, function(err) {
console.log(err)
})
and there you have it, simple url shortner!