intelli-sms-gateway
Version:
A package extending developable features of the Intelli-Africa Solutions SMS Gateway
91 lines (40 loc) • 1.8 kB
Markdown
# Overview
1. Installation
2. Authenticate
3. Assign long string to variable for a bulk sms
4. Call either method for sending bulk or single SMSs
# 1. Installation
```Shell
npm install intelli-sms-gateway
```
# 2. Authentication
**Instantiate Client class byt passing the parameters email and password in that order**
```javascript
import { Client } from "intelli-sms-gateway";
// Import the client class from the client module
let client = new Client('foo@foo.com', '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**
```javascript
// 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*
```javascript
// 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**
```Python
# We send a single SMS after authentication
client.sendSingleSms('Please attend the meeting at 1pm', '263777534224', 'Meeting announcament')
```
# *If your credentials are correct, your messages will not be sent*