Here's the latest documentation on Laravel 5.3 Notifications System:
https://laravel.com/docs/master/notifications
This package makes it easy to send notifications using Sailthru with Laravel 5.8.
Note: Replace Sailthru
Sailthru
Dylan Harbour
dylanharbour
http://ringier.tech
tools@roam.africa
sailthru
:package_description
:style_ci_id
:sensio_labs_id
with their correct values in README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE.md, composer.json and other files, then delete this line.
Tip: Use "Find in Path/Files" in your code editor to find these keywords within the package directory and replace all occurences with your specified term.
This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two.
- Add your Sailthru API details to
config/services
'sailthru' => [
'api_key' => '',
'secret' => '',
],
-
composer require laravel-notification-channels/sailthru-notifications-channel
(Specify Repo until official package is added to the notifications channel repo) -
If required, register the
SailthruServiceProvider
Sign Up on their Website
- Follow standard Notifiable/Notifications Setup for a model.
- If default / global vars are required for all Sailthru calls, add them using the
sailthruDefaultVars
method on your notifiable e.g.
/**
* @return array
*/
public function sailthruDefaultVars(): array
{
return ['global_var_foo' => 'bar'];
}
- Add a
toSailthru
method on your notification, where you define template name and any specific var.
/**
* @param User $user
* @return SailthruMessage
*/
public function toSailthru(User $user)
{
return SailthruMessage::create('reset password')
->toName($user->name)
->toEmail($user->email)
->vars(
[
'reset_password_link' => 'https://www.example.com',
'link_expiration_minutes' => config('auth.reminder.expire', 60),
'first_name' => $user->name,
]
);
}
- Change the
via()
method in your notification to include theSailthruChannel
.
/**
* Get the notification's channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return [SailthruChannel::class];
}
A list of all available options
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email tools@roam.africa instead of using the issue tracker.
Please see CONTRIBUTING for details.
- Developed and Maintained by Ringier Tech & Data and Ringier One Africa Media
- Dylan Harbour
- All Contributors
The MIT License (MIT). Please see License File for more information.