<?php include '../vendor/autoload.php'; $server = ['id' => 'xxxxxx', 'token' => 'abcdef']; $ms = new SquareMS\Api($server['id'], $server['token']); $profile = $ms->getUser(); if (is_array($profile)) { echo "!> SquareMS Profile info: \n"; echo "Name: {$profile['name']} \n"; echo "Username: {$profile['username']} \n"; echo "Email: {$profile['email']} \n"; echo "Age: {$profile['age']} \n"; echo "Register time: {$profile['registerTime']} \n"; } else { echo "!> Error getting SquareMS Profile Info \n"; }
<?php include '../vendor/autoload.php'; $server = ['id' => 'xxxxxx', 'token' => 'abcdef']; $ms = new SquareMS\Api($server['id'], $server['token']); // It'll try to get ALL mails // Note that this is heavy for the server if getting a lot of records // You can specify $limit and $offset // Or none for default values $history = $ms->getMailHistory(); if ($history) { echo '!> You sent ' . count($history) . " mails since you started using the service ! \n"; } else { echo '!> An error occurred getting your history. \\n'; }
<?php include '../vendor/autoload.php'; $server = ['id' => 'xxxxxx', 'token' => 'abcdef']; $ms = new SquareMS\Api($server['id'], $server['token']); $mail = new SquareMS\Mail(['from' => '', 'to' => '', 'subject' => 'Hello World !', 'contents' => ['text' => 'Mail text !', 'html' => 'Mail html !']]); var_dump($ms->sendmail($mail));