I am trying to concat two encodedUri string and I am unable to do it. I am able to send message, but I am receiving only the text message, not the links. Can anyone suggest me any way to solve this problem? Here is my tried solution:
const sms = async (phoneNumber, textMessage, senderId) => {
// if (!text || typeof text != "string") {
// throw new TypeError("Second argument text is required, it must be string");
// }
try {
const link = "https://google.com/uLK1aeSA98DDrktU7/";
const links = encodeURI(link);
const plainText = encodeURI(textMessage);
const text = plainText.concat(links);
const response = await request({
method: "POST",
uri: `https://www.smsalert.co.in/api/push.json?apikey=${apiKey}&sender=${senderId}&mobileno=${phoneNumber}&text=${text}`,
json: true,
});
// console.log(response);
return response;
} catch (error) {
console.error(error);
}
};
sms("+91xxxxxx", "Have you Checked-in.", "FUNPRA");
output i am getting
Have%20you%20Checked-in.https://google.com/uLK1aeSA98DDrktU7/