Download the PHP package oscarcpv/aws-pinpoint-laravel-notification-channel without Composer
On this page you can find all versions of the php package oscarcpv/aws-pinpoint-laravel-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oscarcpv/aws-pinpoint-laravel-notification-channel
More information about oscarcpv/aws-pinpoint-laravel-notification-channel
Files in oscarcpv/aws-pinpoint-laravel-notification-channel
Package aws-pinpoint-laravel-notification-channel
Short Description This package makes it easy to send notifications using AWS Pinpoint with Laravel.
License MIT
Homepage https://github.com/oscarcpv/aws-pinpoint-laravel-notification-channel
Informations about the package aws-pinpoint-laravel-notification-channel
AWS Pinpoint Laravel Notification Channel
This package makes it easy to send notifications using AWS Pinpoint with Laravel.
Only SMS is supported for now. However, any contribution that helps support other types of messages is welcome.
Contents
- Installation
- Setting up the AWS Pinpoint service
- Usage
- Available Message methods
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
Use composer to install the package:
Setting up the AWS Pinpoint service
First, you need to add your credentials to config/services.php
file:
Now, you need to add the following entries in your .env
file
Usage
In your Notification class, you must include the channel in the via method:
Then, add the toAwsPinpoint
method:
You can also define routeNotificationForAwsPinpoint
method in the Model that uses Notifiable trait to define the recipient or recipients:
Then, you can define your toAwsPinpoint
method like this:
You have available these events, for which you are free to implement listeners:
NotificationChannels\AwsPinpoint\Events\DeliverySuccessfull
: Is disptached after the message is sent successfully.NotificationChannels\AwsPinpoint\Events\DeliveryFailed
: Is dispatched if the message could not sent successfully.
Both events receive the following parameters:
mixed $recipient
: The recipient the message was sent to. This parameter can be a string, an array or an integer.mixed $deliveryStatus
: The delivery status returned by AWS Pinpoint. This parameter is a string that represents the delivery status of the message. See AWS Pinpoint Docs for more details about this.mixed $statusMessage
: The status message returned by AWS Pinpoint. This parameter is a string that contains a message describing the delivery status of the message. AWS Pinpoint Docs for more details about this.
Available Message methods
When you instance the NotificationChannels\AwsPinpoint\AwsPinpointMessage
you have available this methods:
body(string $body)
: Set the body of the messagerecipients(mixed $recipients)
: Set the recipients to which the message will be sent. This method accepts a recipient of type string or integer, or an array of recipients.transactional()
: Set the message type to TRANSACTIONAL.promotional()
: Set the message type to PROMOTIONAL.senderId(string $senderId)
: Replace the default sender ID configured inconfig/services.php
.
You can see more details about this concepts in AWS Pinpoint Docs
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
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
- Oscar Poemape
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of aws-pinpoint-laravel-notification-channel with dependencies
aws/aws-sdk-php-laravel Version ^3.8
illuminate/notifications Version ~8.0 || ~9.0 || ~10.0
illuminate/support Version ~8.0 || ~9.0 || ~10.0