[insert_php]
echo ‘Server date and time is: ‘;
echo date(‘l, F j, Y \a\t G:i:s’);
[/insert_php]

[insert_php]
global $current_user;
get_currentuserinfo();

echo $display_name . “‘s email address is: ” . $user_email;
echo ‘Username: ‘ . $current_user->user_login . “\n”;
echo ‘User email: ‘ . $current_user->user_email . “\n”;
echo ‘User level: ‘ . $current_user->user_level . “\n”;
echo ‘User first name: ‘ . $current_user->user_firstname . “\n”;
echo ‘User last name: ‘ . $current_user->user_lastname . “\n”;
echo ‘User display name: ‘ . $current_user->display_name . “\n”;
echo ‘User ID: ‘ . $current_user->ID . “\n”;

# Define your static variables (app group ID, request url)
$app_group_id = ‘b4973d6b-5702-4951-8dc2-643f3eec4dcb’;
$request_url = ‘https://api.appboy.com/users/track’;

// Initialize your users by creating a map containing
// your desired attributes and associated attribute values.

$user1 = array(
‘external_id’=>”$current_user->ID”,
‘first_name’=>”$current_user->user_firstname”,
‘last_name’=>”$current_user->user_lastname”,
’email’=>”$current_user->user_email”,

);

// Note: Arrays in php are really ordered maps, hence
// the ‘array’ initialization associated with each user.

// Instantiate your attributes array using your previously
// defined user maps.
$attributes = array($user1);

// Organize the data to send to the API as another map
// comprised of your previously defined variables.
$postData = array(
‘app_group_id’ => $app_group_id,
‘attributes’ => $attributes,
);

// Create the context for the request
$context = stream_context_create(array(
‘http’ => array(
‘method’ => ‘POST’,
‘header’ => “Content-Type: application/json\r\n”,
‘content’ => json_encode($postData)
)
));

// Send the request
$response = file_get_contents($request_url, FALSE, $context);

// Post the response to ensure a successful request
echo $response;

[/insert_php]