Download the PHP package bundana/services without Composer
On this page you can find all versions of the php package bundana/services. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bundana/services
More information about bundana/services
Files in bundana/services
Package services
Short Description List of API services for development e.g. SMS, WhatsApp, email, etc.
License MIT
Homepage https://github.com/bundana/Laravel-Value-Added-Services
Informations about the package services
Mnotify SMS API Integration
This package provides an easy-to-use interface for integrating the Mnotify SMS API into your PHP applications. The package allows you to send single and bulk SMS, check SMS balance, and register sender IDs with the Mnotify API.
Installation
To use this package, make sure you have the following environment variables set in your .env
file:
Basic Usage
1. Sending a Single SMS
To send a single SMS, you can use the Mnotify::to()
method to specify the recipient’s phone number, followed by the message()
method to set the SMS content. Finally, call send()
to dispatch the message.
2. Checking SMS Balance
To check your SMS balance, use the SMSBalance()
method. This can be done for both API version 1 (default) and version 2.
3. Sending Bulk SMS
To send bulk SMS to multiple recipients, use the sendBulk()
method. This method takes an associative array where the keys are phone numbers and the values are the corresponding messages to send.
4. Registering a Sender ID
To register a sender ID with Mnotify, use the registerSenderID()
method. This method takes two parameters: the sender ID and the purpose for registering the sender ID.
Additional Features
-
Set Custom API Keys: You can dynamically set API keys using the
newKeys()
method if you need to override the environment variables.Example:
-
Scheduled SMS: To schedule SMS for future delivery, you can pass a
schedule_date
to thesend()
method.Example:
Error Handling
Each method returns a JSON-encoded response. If an error occurs, the response will include an error message and a status of false
.
Example error response:
API Versioning
By default, the package uses Mnotify API version 1 (v1
). If you need to use API version 2, pass 'v2'
as a parameter when sending messages or checking the balance.
License
This package is open-source and licensed under the MIT License.
This README.md
file provides comprehensive documentation for using the Mnotify class, covering the key functionalities such as sending SMS, checking balance, bulk SMS, and registering sender IDs. You can further extend this document with additional details if required.