https://github.com/laravel-notification-channels/vwo-engage
VWO Engage (previously PushCrew) notifications channel for Laravel
https://github.com/laravel-notification-channels/vwo-engage
laravel laravel-package notifications pushcrew vwo-engage
Last synced: 2 months ago
JSON representation
VWO Engage (previously PushCrew) notifications channel for Laravel
- Host: GitHub
- URL: https://github.com/laravel-notification-channels/vwo-engage
- Owner: laravel-notification-channels
- License: mit
- Created: 2016-10-06T09:36:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T11:02:46.000Z (almost 5 years ago)
- Last Synced: 2025-03-29T03:32:12.334Z (3 months ago)
- Topics: laravel, laravel-package, notifications, pushcrew, vwo-engage
- Language: PHP
- Homepage: http://laravel-notification-channels.com
- Size: 24.4 KB
- Stars: 0
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# VWO Engage (previously PushCrew) Push Notifications Channel for Laravel
[](https://packagist.org/packages/laravel-notification-channels/vwo-engage)
[](LICENSE.md)
[](https://travis-ci.org/laravel-notification-channels/vwo-engage)
[](https://styleci.io/repos/70140859)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/vwo-engage)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/vwo-engage/?branch=master)
[](https://packagist.org/packages/laravel-notification-channels/vwo-engage)This package makes it easy to send notifications using [VWO Engage](https://vwo.com/engage) with Laravel.
## Contents
- [Installation](#installation)
- [Setting up the VWO Engage service](#setting-up-the-vwo-engage-service)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)## Installation
You can install the package via composer:
``` bash
composer require laravel-notification-channels/vwo-engage
```### Setting up the VWO Engage service
Add your VWO Engage API Token to your `config/services.php`:
```php
// config/services.php
'vwo-engage' => [
'token' => env('VWO_ENGAGE_API_TOKEN'),
]
```## Usage
Now you can use the channel in your `via()` method inside the notification:
```php
use Illuminate\Notifications\Notification;
use NotificationChannels\Engage\EngageChannel;
use NotificationChannels\Engage\EngageMessage;class AccountApproved extends Notification
{
public function via($notifiable)
{
return [EngageChannel::class];
}public function toEngage($notifiable)
{
return EngageMessage::create()
->subject('Your account was approved!')
->body('Click here to see details.')
->icon('https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Laravel.svg/231px-Laravel.svg.png')
->url('https://vwo.com/engage');
}
}
```In order to let your Notification know which VWO Engage subscriber(s) you are targeting, add the `routeNotificationForEngage` method to your Notifiable model.
```php
public function routeNotificationForEngage()
{
return 'VWO_ENAGE_SUBSCRIBER_ID';
}
```You can either return a single subscriber-id, or if you want to notify multiple subscriber IDs just return an array containing all IDs.
To determine the Subscriber ID read this [FAQ](https://help.vwo.com/hc/en-us/articles/360007743913-How-can-I-determine-the-Subscriber-ID-of-a-visitor-to-my-site-).
### Available Message methods
- `subject('')`: Accepts a string value for the title.
- `body('')`: Accepts a string value for the notification body.
- `icon('')`: Accepts an url for the icon.
- `url('')`: Accepts an url for the notification click event.For more information [take a look here](http://api.pushcrew.com/docs/send-to-a-list-of-subscribers).
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ php vendor/bin/phpunit
```## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Davide Bellini](https://github.com/billmn)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.