intelli-sms-gateway
v1.0.0
Published
A package extending developable features of the Intelli-Africa Solutions SMS Gateway
Downloads
4
Maintainers
Readme
Overview
Installation
Authenticate
Assign long string to variable for a bulk sms
Call either method for sending bulk or single SMSs
1. Installation
npm install intelli-sms-gateway
2. Authentication
Instantiate Client class byt passing the parameters email and password in that order
import { Client } from "intelli-sms-gateway";
// Import the client class from the client module
let client = new Client('[email protected]', 'password');
// This line of code with Authenticate you. Should you not be authenticated, it will raise an exception
Should the client be authenticated, this instantiation will return a property of value True. The reverse is true.
3. Getting Details for bulk SMS
Define a variable, assign to it the phone numbers that are expected to receive the text message Phone numbers must be in the format 263777534224
// An example of the format of the string with mobile numbers
let textReceivers = "263789224445,263777534224";
4. Sending the messages
Bulk SMSes
Call the single SMS method of the client instance and pass the required parameters namely: message, textReceivers, title
// We send a bulk SMS after authentication
client.sendBulkSms(`Please attend the meeting at 1pm', ${textReceivers}, 'Meeting announcament`);
Single SMSes
Call the single SMS method of the client instance and pass the required parameters namely: message, receiver, title Phone numbers must be in the format 263777534224
# We send a single SMS after authentication
client.sendSingleSms('Please attend the meeting at 1pm', '263777534224', 'Meeting announcament')