![]() ![]() In general, for best global delivery of SMS, follow these best practices:Īvoid using special symbols like "€" in the text messageĪvoid links, religious, political and adult content There are specific rules to be followed for sending SMS in certain countries. The main SMS features in different countries are summarized in this spreadsheet. For example, depending on where your recipients are located, you may or may not be able to use an alphanumeric SMS sender ID. Regulations change significantly depending on where you are sending text messages. $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message) Ĭurl_setopt($ch, CURLOPT_POSTFIELDS, $data) Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ĭef sendSMS(apikey, numbers, sender, message):ĭata = platform supports over 225 countries as destinations for SMS messaging. Now, All we need to do is import the smsClient and call appropriate functions wherever required. I’ve created a file named smsClient.js where multiple functions are defined for different SMS. We don’t need any external client in this case but Axios helps us in creating a client instance with default params so that the API URL, API key and Sender ID need not be passed in every request manually. All we need to do is send a POST request to the API with API key, sender ID, phone number and the message body The service provider that I’m using has a REST API. Hosted with ❤ by GitHub SMS Code explanation const smsClient = require("./smsClient") Now import the client in any other file or wherever required and run these functions This code was posted for an article at ĪpiKey: "YOUR API KEY", //Text local api key Let me show you how we send SMS from API in our Express app. I’m using Text Local as the SMS service provider and we have an Express Node.js backend. ![]() Many Service providers have client libraries and SDKs to make it easier for the developers to send SMS programmatically. Once the template is approved, You can start sending SMS from the service provider’s dashboard or using their API. Here’s an example of SMS template for sending verification code or OTP SMS template example This limit is to make sure that users won’t use the transactional SMS to send promotional SMS content. Only pre-approved SMS templates can be sent as transactional SMS. The service provider will verify your documents and approve your account for transactional SMS. You should also mention the 6 letter ID that you would like to use as sender ID. You’ll receive a sample format for letter of consent in which you can fill your name, your business name, sign it and send it. Here’s an example of opt-in proof Opt-in proof Documents are as follows :ġ. Opt-in permission in the privacy policy You need to send a few documents to the service provider. Transactional SMS has an approval process. Transactional SMS doesn’t have any limit on the timings and the SMS will also be sent to DND numbers. Transactional SMS is used to send welcome SMS, verification codes, OTPs, Order status SMS etc. Promotional SMS is sent from a random ID which is available from the service provider at the time of sending SMS.Promotional SMS is not sent to DND (Do not disturb) numbers.Promotional SMS can only be sent between 9 AM and 9 PM. ![]() This is the type of SMS that could lead to spam so there are some rules with promotional SMS You can simply register with any SMS provider and start sending single or bulk SMS from the service provider’s web dashboard. ![]() There’s no approval needed for promotional SMS. This SMS is not really important for users. Promotional SMS is used to send promotions, offers, discounts etc. There are two types of SMS which can be sent programmatically. I’m explaining these from India’s perspective. There are different rules in different countries with regard to SMS depending on the telecom authority of that country. There are some rules for what SMS can be sent, what ID you’ll be assigned, and at what time the SMS can be sent. Most beginner developers might not know the process of SMS approval. Their approval process was pretty fast as well. I’ve recently started working on an app and I needed an SMS service to send transactional SMSĪfter some research, I found Textlocal to be a viable option with decent pricing, automated campaigns, automated reports, and good support. Sending SMS is one of the essential features for any app’s backend. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |