bulk-zap
v1.0.3
Published
Here's the README.md file updated with the package name "bulk-zap":
Downloads
3
Readme
Here's the README.md file updated with the package name "bulk-zap":
# bulk-zap
bulk-zap is an npm package that enables you to send bulk messages via WhatsApp using the Twilio API.
## Installation
To install bulk-zap, you can use npm:
```bash
npm install bulk-zap
Usage
const BulkZap = require('bulk-zap');
// Initialize BulkZap with your Twilio credentials and WhatsApp number
const bulkZapClient = new BulkZap(accountSid, authToken, fromNumber);
// Define your message
const messages = "Your message goes here.";
// Specify the numbers you want to send messages to
const toNumbers = ["recipientNumber1", "recipientNumber2", ...];
// Send bulk messages
bulkZapClient.sendBulkMessages(messages, toNumbers)
.then(response => {
console.log("Messages sent successfully:", response);
})
.catch(error => {
console.error("Error sending messages:", error);
});
Constructor
BulkZap(accountSid, authToken, fromNumber)
accountSid
(string): Your Twilio Account SID.authToken
(string): Your Twilio Auth Token.fromNumber
(string): Your WhatsApp-enabled Twilio phone number.
Method
sendBulkMessages(messages, toNumbers)
Sends bulk messages to specified WhatsApp numbers.
messages
(string): The message you want to send.toNumbers
(array of strings): An array of recipient WhatsApp numbers.
Example
const BulkZap = require('bulk-zap');
const bulkZapClient = new BulkZap('your_account_sid', 'your_auth_token', 'your_whatsapp_number');
const messages = "Hello from bulk-zap!";
const toNumbers = ["recipientNumber1", "recipientNumber2"];
bulkZapClient.sendBulkMessages(messages, toNumbers)
.then(response => {
console.log("Messages sent successfully:", response);
})
.catch(error => {
console.error("Error sending messages:", error);
});
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Make sure to replace `"your_account_sid"`, `"your_auth_token"`, and `"your_whatsapp_number"` with your actual Twilio credentials and phone number. Additionally, include a `LICENSE.md` file with appropriate licensing information.