Created
June 16, 2010 07:42
-
-
Save stammy/440293 to your computer and use it in GitHub Desktop.
WP-Notifo notifo_message()
This file contains 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 | |
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