dasun4u/laravel-shoutout-messaging

shoutout messaging library for laravel

v2.0.5 2023-08-29 20:32 UTC

This package is auto-updated.

Last update: 2024-04-29 22:05:28 UTC


README

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