Skip to content

Instantly share code, notes, and snippets.

@jeremyFreeAgent
Last active September 17, 2015 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyFreeAgent/a9a71e1c1c1206380f96 to your computer and use it in GitHub Desktop.
Save jeremyFreeAgent/a9a71e1c1c1206380f96 to your computer and use it in GitHub Desktop.
jolicode/jolinotif example
<?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