<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$data = $_POST["mandrill_events"];
//$a = print_r($data);
//$unescaped_data = stripslashes($data);
$obj = json_decode($data);
$event=$obj->event;
$city=$obj->location->city;
$country=$obj->location->country;
//date_default_timezone_set('America/Sao_Paulo');
//$today = date("Y-m-d H:i:s");
//require './class.phpmailer.php';
// Assemble the body of the email...
$message_body = $event.'
'
.$city.'
'
.$country.'
'. $data;
mail('email',
'Balantel Webbook Open',
$message_body);
?>
this code returns only this at email:
[{\"event\":\"open\",\"ts\":1374797119,\"user_agent\":\"Mozilla\\/5.0 (Windows NT 5.1) AppleWebKit\\/535.6 (KHTML, like Gecko) Chrome\\/16.0.897.0 Safari\\/535.6\",\"user_agent_parsed\":{\"type\":\"Browser\",\"ua_family\":\"Chrome\",\"ua_name\":\"Chrome 16.0.897.0\",\"ua_version\":\"16.0.897.0\",\"ua_url\":\"http:\\/\\/www.google.com\\/chrome\",\"ua_company\":\"Google Inc.\",\"ua_company_url\":\"http:\\/\\/www.google.com\\/\",\"ua_icon\":\"http:\\/\\/cdn.mandrill.com\\/img\\/email-client-icons\\/chrome.png\",\"os_family\":\"Windows\",\"os_name\":\"Windows XP\",\"os_url\":\"http:\\/\\/en.wikipedia.org\\/wiki\\/Windows_XP\",\"os_company\":\"Microsoft Corporation.\",\"os_company_url\":\"http:\\/\\/www.microsoft.com\\/\",\"os_icon\":\"http:\\/\\/cdn.mandrill.com\\/img\\/email-client-icons\\/windowsxp.png\",\"mobile\":false},\"ip\":\"69.194.234.35\",\"location\":{\"country_short\":\"US\",\"country\":\"United States\",\"region\":\"Texas\",\"city\":\"Houston\",\"latitude\":29.7632808685,\"longitude\":-95.3632736206,\"postal_code\":\"77069\",\"timezone\":\"-05:00\"},\"msg\":{\"ts\":1374796960,\"subject\":\"[JCI] Cadastro Realizado!\",\"email\":\"paulojoao406+alceu@gmail.com\",\"tags\":[],\"opens\":[{\"ts\":1374797119,\"ip\":\"69.194.234.35\",\"location\":\"Texas, US\",\"ua\":\"Windows\\/Windows XP\\/Chrome\\/Chrome 16.0.897.0\"}],\"clicks\":[],\"state\":\"sent\",\"_id\":\"8b2fa5f2dfb04e9ba58a05484638881f\",\"_version\":\"yYAgZ4zgJHoLpoQ1_zsnJQ\",\"sender\":\"marketing@jcicomercio.com.br\",\"template\":null}}]