PHP code example of surfnet / messagebird-api-client-bundle
1. Go to this page and download the library: Download surfnet/messagebird-api-client-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
surfnet / messagebird-api-client-bundle example snippets
public function registerBundles()
{
// ...
$bundles[] = new Surfnet\MessageBirdApiClientBundle\SurfnetMessageBirdApiClientBundle;
}
public function fooAction()
{
$message = new \Surfnet\MessageBirdApiClient\Messaging\Message(
'SURFnet',
'31612345678',
'Your one-time SMS security token: 9832'
);
/** @var \Surfnet\MessageBirdApiClientBundle\Service\MessagingService $messaging */
$messaging = $this->get('surfnet_message_bird_api_client.messaging');
$result = $messaging->send($message);
if ($result->isSuccess()) {
// Message has been buffered, sent or delivered.
}
}