ringlesoft/jasmin-client

Jasmin Client

Seamlessly interact with Jasmin SMS Gateway from your Laravel application.

A powerful Laravel package designed to seamlessly interact with the Jasmin SMS Gateway, enabling developers to send and receive SMS messages effortlessly. Built on the robust features of the Jasmin SMS Gateway, this package supports both HTTP and SMPP protocols, allowing for flexible message routing and delivery.

Experience the convenience of SMS messaging with Jasmin Client, tailored specifically for Laravel developers.

Jasmin Client
SMS Features

Package Features

HTTP & SMPP Support

Supports both HTTP and SMPP protocols for flexible message routing and delivery.

Easy Integration

Seamlessly integrates with your existing Laravel application with minimal configuration.

Send & Receive SMS

Full support for sending and receiving SMS messages through Jasmin Gateway.

Laravel Notifications

Works with Laravel's notification system for easy SMS notifications.

Delivery Reports

Track message delivery status with built-in delivery report handling.

Getting Started

Jasmin Client is designed to make SMS integration simple. Install the package, configure your Jasmin Gateway credentials, and start sending messages in minutes.

Perfect For

Notification Systems

Send SMS notifications for order updates, appointment reminders, and alerts.

Two-Factor Authentication

Implement SMS-based 2FA for enhanced security in your applications.

Marketing Campaigns

Send bulk SMS messages for marketing and promotional campaigns.

Ready to Send SMS?

Install the package today and start sending SMS messages from your Laravel app.

Jasmin SMS Gateway Client for Laravel

Latest Version on Packagist Total Downloads PHP Version Require Dependents


A Laravel package for seamless integration with Jasmin SMS Gateway, supporting HTTP, REST API, and SMPP connections.

Features

  • Easy-to-use interface for sending and receiving SMS
  • Support for HTTP and REST API jasmin options
  • SMPP is still experimental: Try SMPP only for non-critical applications
  • Delivery report handling

Installation

You can install the package via composer:

composer require ringlesoft/jasmin-client

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="RingleSoft\JasminClient\JasminClientServiceProvider"

Then, edit the config/jasmin_client.php file with your Jasmin SMS Gateway credentials and preferred settings.

Available configurations

The following are available configurations. Most of these are just defaults and can be overridden in your code

  • url : The base url of the jasmin server (include the port if different from 80 or 443/446)
  • username : The username for your jasmin account
  • password : The password for your jasmin account
  • dlr_callback_url : The default sms delivery callback url
  • batch_callback_url : the default batch callback url
  • batch_errback_url : the default batch errback url
  • default_dlr_method : the default dlr method (GET/POST)
  • default_dlr_level : The default DLR level (1, 2, or 3)
  • batch_chunk_size : The default Chunk size for batches

Usage

Sending an SMS

Sending a single message (Http & Rest)

$sms = JasminClient::message()
    ->content('Hello there! Have a nice day')
    ->to("255711000000")
    ->from('INFO')
    ->via('rest') // 'rest' or 'http'
    ->send();
  • Returns RingleSoft\JasminClient\Models\Jasmin\SentMessage

Sending multiple messages as a batch (Rest only)

    $message = JasminClient::message(to: "255711000000", content: "Hello There. Have a nice day");
    $message2 = JasminClient::message(to: "255711000002", content: "Hello There. Have a nice day");
    $batch = JasminClient::batch()
    ->addMessage($message)
    ->addMessage($message2)
    ->from("INFO")
    ->send();
  • Returns RingleSoft\JasminClient\Models\Jasmin\SentBatch

Handling Delivery Statuses

This package provides a streamlined way to handle delivery statuses.

Class DlrController extends Controller
{
    public function handleDlr(Request $request)
    {
        return JasminClient::receiveDlrCallback($request, function(DeliveryCallback $dlr) {
            // do something with the dlr and return true for success or false for failure
            // For example, you can dispatch a job to process the Delivery Report
            return true;
        });
    }
}

Handling Batch Callback Requests

When messages are sent in a batch, Jasmin responds with the ID of the batch created (batchId) and enqueue the messages. When each message is sent to SMC, jasmin fires a callback (batch callback) with messageId of each message within the batch.

To handle batch callbacks, you can use the receiveBatchCallback method.

Class DlrController extends Controller
{
    public function handleDlr(Request $request)
    {
        return JasminClient::receiveDlrCallback($request, function(DeliveryCallback $dlr) {
            // do something with the dlr and return true for success or false for failure
            // For example, you can dispatch a job to process Batch Callback
            return true;
        });
    }
}

Checking rates (Http & Rest)

    $route = JasminClient::rest()->checkRoute("255711000000");

Checking account balance (Http & Rest)

    $balance = JasminClient::rest()->checkBalance();

Monitoring Metrics (Http)

    $metrics = JasminClient::http()->getMetrics();

Contributing

I'll soon let you know when you can contribute to this project.

License

This package is open-sourced software licensed under the MIT license.

Support

Contacts

Follow me on X: @ringunger
Email me: [email protected]
Website: https://ringlesoft.com

Note: This package is still under development. Please report any issues you encounter.