SMS is a common method of sending short messages between cell phones, but these SMS can be sent to multiple users at a time using Twilio notify service. Sending bulk SMS to users at a time is possible using Twilio.
- It’s easy to get started and easy to use.
- It is widely used for sending bulk SMS.
- User can send SMS to desired mobile numbers fastly and efficiently.
Installation of Twilio module:
- You can visit the link to Install twilio module. You can install this package by using the following command.
npm install twilio
- After installing twilio you can check your twilio version in command prompt using the command.
npm version twilio
- After that, you can create a folder and add a file. For example
index.js. To run this file you need to run the following command.
- Requiring module: You need to include twilio module in your file by using these lines.
const client = require('twilio')(YOUR_ACCOUNT_SID, YOUR_AUTH_TOKEN);
- Go to Twilio official website and create your account. After login, go to your dashboard and you can get your auth_token and account_sid.
- Now go to console/notify/services and create your own notify service.
- Now select a message service sid, if is it not showing then you have to create a message service sid and add a phone number to it and then you can see that message service sid in the drop-down as shown below.
- Copy your service_sid and click the save button.
- The project structure will look like this:
- Make sure you have installed twilio using the following commands:
npm install twilio
- Run index.js file using following command:
- SMS send successfully to all numbers passed as parameter.
- Sending bulk emails in Node.js using SendGrid API
- Sending SMS using NEXMO API in Node.js
- How to get daily weather notification on mobile using Node.js and Twilio API ?
- Nodejs | Automatic restart NodeJs server with nodemon
- How to create button to open SMS compose to a phone number using HTML ?
- PHP | Sending mails using mail() function
- Sending Emails Using API in Flask-Mail
- Sending Push Notifications : Progressive Web Apps
- Nodejs - Connect MongoDB with Node app using MongooseJS
- Cowsay in Nodejs using Requests library
- Nodejs | Web Crawling using Cheerio
- Signup Form Using Nodejs and MongoDB
- Nodejs | authentication using Passportjs and passport-local-mongoose
- NodeJs CRUD Operations Using Mongoose and MongoDB Atlas
- Generating Lighthouse Scores using NodeJS
- Web-Socket in NodeJS
- Dockerizing a simple Nodejs app
- Nodejs | DNS
- Encrypting Data in NodeJS
- Difference between NodeJS and AngularJS
Steps to get your YOUR_ACCOUNT_SID, YOUR_AUTH_TOKEN and YOUR_SERVICE_SID:
Steps to run the program:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.