Skip to content

Instantly share code, notes, and snippets.

@stammy
Created June 16, 2010 07:42
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 stammy/440293 to your computer and use it in GitHub Desktop.
Save stammy/440293 to your computer and use it in GitHub Desktop.
WP-Notifo notifo_message()
<?php
function notifo_message($title,$msg,$uri = false,$to = false)
{
$notifo_pass = get_option('notifo_api_key');
$notifo_user = get_option('notifo_username');
$data = array('label' => get_bloginfo('name'), 'title' => $title, 'msg' => $msg);
if($uri)
{
$data['uri'] = $uri;
}
if($to)
{
$data['to'] = $to;
}
$ch = curl_init("https://api.notifo.com/v1/send_notification");
curl_setopt($ch, CURLOPT_USERPWD, $notifo_user.":".$notifo_pass);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
}?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment