dasun4u / laravel-shoutout-messaging
shoutout messaging library for laravel
v2.0.5
2023-08-29 20:32 UTC
Requires
- php: >=8.0
- guzzlehttp/guzzle: 7.8.0
Requires (Dev)
- phpunit/phpunit: >=7.0.0
This package is auto-updated.
Last update: 2025-03-29 00:47:38 UTC
README
Laravel Shoutout Messaging
Shoutout messaging library for Laravel
Requirements
- PHP 8.0+
- Laravel 8.0+
Installation
- Install the package by running this command in your terminal/cmd:
composer require dasun4u/laravel-shoutout-messaging
- Import config file by running this command in your terminal/cmd and change the configs accordingly
php artisan vendor:publish --provider="Dasun4u\LaravelShoutoutMessaging\ShoutoutServiceProvider"
- Change the imported config file (
config/shoutout_message.php
) accordingly
'api_key' => 'XXXXXXXXX.XXXXXXXXX.XXXXXXXXX', 'sms_source' => 'ShoutDEMO', 'email_source' => 'ShoutDEMO <shoutdemo@getshoutout.com>',
- Send SMS
use Dasun4u\LaravelShoutoutMessaging\Shoutout; $shoutout = new Shoutout(); $destinations = ["+94712345678"]; // Multiple numbers can add as array $content = "Test SMS"; $response = $shoutout->sendSMS($destinations, $content);
- Send Email
use Dasun4u\LaravelShoutoutMessaging\Shoutout; $shoutout = new Shoutout(); $destinations = ["test@test.com"]; // Multiple numbers can add as array $subject = "Test Subject"; $content = "<h1>Test html content</h1>"; // Html body $response = $shoutout->sendEmail($destinations, $subject, $content);
- Get Response Data
$response_body = $response->getBody(); // Get response $response_body = json_decode($response->getBody(), true); // Get response as associative array $response_status_code = $response->getStatusCode(); // Get status code
Author
License
This project is licensed under the MIT License - see the LICENSE file for details