Last active
September 17, 2015 15:17
-
-
Save jeremyFreeAgent/a9a71e1c1c1206380f96 to your computer and use it in GitHub Desktop.
jolicode/jolinotif example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
<<<CONFIG | |
packages: | |
- "jolicode/jolinotif: dev-master" | |
CONFIG; | |
use Joli\JoliNotif\Notification; | |
use Joli\JoliNotif\NotifierFactory; | |
$notifier = NotifierFactory::create(); | |
if ($notifier) { | |
$notification = | |
(new Notification()) | |
->setTitle('Notification example') | |
->setBody('This is a notification example launch with melody!') | |
->setIcon('https://raw.githubusercontent.com/jolicode/JoliNotif/master/example/icon-success.png') | |
->setCallback('http://melody.sensiolabs.org/') | |
; | |
$result = $notifier->send($notification); | |
echo 'Notification ', $result ? 'successfully sent' : 'failed', ' with ', get_class($notifier), PHP_EOL; | |
} else { | |
echo 'No supported notifier', PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment