laravel-notification-channels / intercom
Intercom Notifications Driver
Installs: 23 626
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 6
Forks: 7
Open Issues: 1
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^6.3 || ^7.0
- illuminate/notifications: ~6.0 || ~7.0 || ~8.0 || ~9.0
- illuminate/support: ~6.0 || ~7.0 || ~8.0 || ~9.0
- intercom/intercom-php: ^3.2 || ^4.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ~8.5
- scrutinizer/ocular: ^1.5
This package is auto-updated.
Last update: 2024-10-28 02:32:37 UTC
README
This package makes it easy to send notifications using Intercom with Laravel.
Contents
Installation
You can install the package via composer:
composer require laravel-notification-channels/intercom
Setting up the Intercom service
Add the followings to your config/services.php
'intercom' => [ 'token' => env('INTERCOM_API_KEY') ]
Add your Intercom Token to .env
INTERCOM_API_KEY=xxx
Usage
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\Intercom\IntercomChannel; use NotificationChannels\Intercom\IntercomMessage; use Illuminate\Notifications\Notification; class TestNotification extends Notification { public function via($notifiable) { return ["intercom"]; } public function toIntercom($notifiable): IntercomMessage { return IntercomMessage::create("Hey User!") ->from(123) ->toUserId(321); } }
Available methods
body('')
: Accepts a string value for the Intercom message bodyemail()
: Accepts a string value for the Intercom message typeemail
inapp()
: Accepts a string value for the Intercom message typeinapp
(default)subject('')
: Accepts a string value for the Intercom message body (using withemail
type)plain()
: Accepts a string value for the Intercom message plain templatepersonal()
: Accepts a string value for the Intercom message personal templatefrom('123')
: Accepts a string value of the admin's id (sender)to(['type' => 'user', 'id' => '321'])
: Accepts an array value for the recipient datatoUserId('')
: Accepts a string value for the Intercom message user by id recipienttoUserEmail('')
: Accepts a string value for the Intercom message user by email recipienttoContactId('')
: Accepts a string value for the Intercom message contact by id recipient
More info about fields read in Intercom API Reference
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email android991@gmail.com instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.