Skip to content

dasun4u/laravel-shoutout-messaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image3

Laravel Shoutout Messaging

Shoutout messaging library for Laravel

Latest Stable Version Total Downloads License StyleCI

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

Special Thanks to