TextLocal SMS Gateway API using PHP without rawurlencode

105 views Asked by At

I am sending SMS using TextLocal.in API but this is how it looks because of line breaks in my SMS template.

It looks like this:

enter image description here

Please take a look at the contents of the $message variable. If I even mistakenly remove the line break then the SMS is not sent and response returns as "Invalid Template". Not only that, it even "looks bad" in the code placing the text this way and whenever I see it I feel a sudden urge to change it. Therefore, to ensure that things are intact forever and minimize the chances of errors, I would like to change it to this:

Hi, welcome. Your Login OTP is '.$code.'<br><br> Please use this OTP to login to your account and connect with people and access ebooks.<br><br> Shubham Jha.

However, it doesn't work. Only the former works and SMS is successfully sent. How can I change it?

1

There are 1 answers

0
ARJUN PS On

Kindly review the SMS template that you uploaded on Textlocal.in.

Template formats seem to be the obsession of SMS gateways. This is due to the fact that, as far as I'm aware, template forms are crucial, and SMS gateways cross-check this information with TRAI-registered templates, or the TRAI itself does so. The others remained fixed, just the variable portion changed.