A Node.js library for sending bulk sms using nexmo from Phone Numbers listed in a file
~$ npm install nexmo-bulk-sms
After Installing import nexmo-bulk-sms
var nexmoBulk = require('nexmo-bulk-sms');
Create your api key and api secret from nexmo
nexmoBulk.setCredentials(apiKey, apiSecret);
from :- the Sender of the message,
toPath :- the file path containing the Phone Numbers
message :- the content of the message to be sent
split (Optional) :- the string/parameters seperating the phone numbers, defaults to ','
N.B :- Ignore the '+' sign infront of phone numbers, instead of '+23456868' use '23456868'
This sends the messages as a synchronous process
nexmoBulk.sendSms(from,toPath,message,split);
nexmoBulk.sendSms('google','./google.txt','hello world')
nexmoBulk.sendSms('google','./google.txt','hello world','**')
nexmoBulk.sendSmsAsync(from,toPath,message,split).then( (success) => {
Console.log(success)
}).catch(err => Console.log(err))
If you would like to contribute, fork the repo, make your changes and create a pull request
This Library was released under MIT License