Giter Club home page Giter Club logo

laravel-notification-channel-textlocal's Introduction

This package allows to send SMS using Textlocal API using laravel notifications

Supports Laravel 5.5 to 6.x

Found any bugs or improvement open an issue or send me a PR

Latest Stable Version License Total Downloads

This package makes it easy to send notifications using textlocal with Laravel 5.3.+

Contents

Installation

Create an account in textlocal then create an API key or hash(password).

composer require msonowal/laravel-notification-channel-textlocal

Setting up the textlocal service

default textlocal config update as desired

return [
	'username'  => env('TEXTLOCAL_USERNAME'),
	'password'  => env('TEXTLOCAL_PASSWORD'),
	'hash'      => env('TEXTLOCAL_HASH'),
	'api_key'   => env('TEXTLOCAL_API_KEY'),
	'sender'    => env('TEXTLOCAL_SENDER'),
	'request_urls' => [
		'IN' => 'https://api.textlocal.in/',
		'UK' => 'https://api.txtlocal.com/'
	],
	'country'   => env('TEXTLOCAL_COUNTRY', 'IN'),
];

Configuring .env

    TEXTLOCAL_USERNAME=Your email id or api key
    TEXTLOCAL_HASH=get it from url '/docs/' under your API KEYS section
    TEXTLOCAL_API_KEY get it from url '/docs/' under your API KEYS section
    TEXTLOCAL_SENDER=Name of the Sender that will be displayed to the recipient (max 6 Characters).
    TEXTLOCAL_COUNTRY=Your Two letter(ISO-3166-alpha-2) Country Code. It should be the Country of the TEXTLOCAL account.

Publish Config

    php artisan vendor:publish --tag=textlocal

Currently, only textlocal of two country is supported IN(India) and UK(United Kingdom).

Usage

Implement this method routeNotificationForTextlocal() in your notifiable class/model which will return array of mobile numbers. Please make sure the mobile number contains the dial code as well (e.g +91 for India). And lastly implement toSms() method in the notification class which will return the (string) sms or template that is defined in textlocal account that needs to be send.

Available Message methods

A list of all available options

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

TODO

Need to convert to Guzzle Http as a Client in core Add more countries add tests

laravel-notification-channel-textlocal's People

Contributors

freekmurze avatar mpociot avatar msonowal avatar nikugogoi avatar shankarakunuri avatar tsainadh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.