codechito / laravel-transmitmessage-channel
:package_description
Requires
- php: >=7.2
- codechito/php-client-sdk: dev-master
- illuminate/notifications: ~5.5 || ~6.0
- illuminate/support: ~5.5 || ~6.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2025-03-29 00:50:44 UTC
README
Please see this repo for instructions on how to submit a channel proposal.
This package makes it easy to send notifications using TransmitMessage with Laravel 5.5+ and 6.x
Contents
Installation
You can install the package via composer:
composer require codechito/laravel-transmitmessage-channel
Setting up the TransmitMessage service
Add the environment variables to your config/services.php:
// config/services.php
...
'transmitmessage' => [
'apiKey' => env('TRANSMITMESSAGE_APIKEY'),
],
...
Add your TransmitMessage API Key to your .env:
// .env
...
TRANSMITMESSAGE_APIKEY=
],
...
Usage
You can use the channel in your via() method inside the notification:
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use NotificationChannels\TransmitMessage\TransmitMessageChannel;
use NotificationChannels\TransmitMessage\TransmitMessageMessage;
class SmsSend extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [TransmitMessageChannel::class];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toTransmitMessage($notifiable)
{
return (new TransmitMessageMessage())
->setMessage('The introduction to the notification.')
->setRecipient('639481234567')
->setSender('SHARKY');
}
}
Available Message methods
A list of all available options
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Known Issues
if you encounter these error
certificate problem: unable to get local issuer certificate
for production we recommend to follow these link for fixing these issue
but if you are in a rush and working only in local enviroment you can just replace the following
- go to \vendor\transmitmessage\php-client-sdk\src\Configuration.php
- replace
https://api.transmitmessage.com/v1/
withhttp://api.transmitmessage.com/v1/
these will fixed the issue temporarily
Security
If you discover any security related issues, please email chito@burstsms.com 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.