Exemplo n.º 1
0
<?php

/**
 * Include Composer autoloader
 */
require_once __DIR__ . '/../../vendor/autoload.php';
/**
 * Import Sms client
 */
use Nexmo\Sms;
/**
 * Load config, expecting an array with:
 * api_key, api_secret
 */
$config = (include __DIR__ . '/../../config-local.php');
/**
 * Get an SMS client object
 */
$sms = new Sms($config);
/**
 * Now lets search for a message
 */
$results = $sms->searchMessage(['id' => $config['search']['id']]);
/**
 * Dump out results
 */
print_r($results);
Exemplo n.º 2
0
<?php

/**
 * Include Composer autoloader
 */
require_once __DIR__ . '/../../vendor/autoload.php';
/**
 * Import Sms client
 */
use Nexmo\Sms;
/**
 * Load config, expecting an array with:
 * api_key, api_secret, to, from, text
 */
$config = (include __DIR__ . '/../../config-local.php');
/**
 * Get an SMS client object
 */
$sms = new Sms($config);
/**
 * Now lets send a message
 */
$results = $sms->send(['from' => $config['from'], 'to' => $config['to'], 'text' => $config['text']]);
/**
 * Dump out results
 */
print_r($results);
Exemplo n.º 3
0
 public function sendLink($number, $callid)
 {
     $this->sms->send(['to' => $number, 'from' => $this->from, 'text' => 'Get your photos here: ' . $this->web . '/' . $callid . '.html']);
 }