Commit 2fc04900 by Arun Raj

Sevasram notification api

parent 0df276aa
......@@ -403,13 +403,21 @@ function func($new_status, $old_status, $post)
{
$category_detail=get_the_category($post->ID);//$post->ID
//echo "<PRE>";print_r($category_detail);exit;
$data = array(
"message" => $post->post_content,
"title" => $post->post_title
);
foreach($category_detail as $cd)
{
if($cd->slug=='news')
{
$curl = curl_init( 'http://52.55.205.218:5555/notification/sendnotificationtoall' );
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, array( 'message' => 'some data', 'title' => 'some more data' ) );
curl_setopt( $curl, CURLOPT_POSTFIELDS, http_build_query($data) );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec( $curl );
curl_close( $curl );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment