public function testMessage() { $str_client = 'test'; $str_api_key = '123test'; $str_event = 'service_message'; $str_title = "Hello"; $str_body = "From 1885"; $str_from = "ELB"; $obj_client = new \Venditan\Rapport\Client($str_client, $str_api_key); $obj_client->addMessage()->title($str_title)->body($str_body)->from($str_from); $obj_data = $obj_client->event($str_event)->compile(); $this->assertEquals((object) ['client' => $str_client, 'key' => $str_api_key, 'type' => $str_event, 'message' => (object) ['title' => $str_title, 'body' => $str_body, 'from' => $str_from]], $obj_data); }
<?php /** * Order placed example */ require __DIR__ . '/../vendor/autoload.php'; $obj_client = new \Venditan\Rapport\Client('test', 'api-key-goes-here-121gw'); $obj_client->addUser()->id('1955')->name('Marty')->email('*****@*****.**')->mobile('07019551985'); $obj_client->addTransaction()->id('2015'); $obj_client->event('order_placed')->send();
<?php /** * Service message example */ require __DIR__ . '/../vendor/autoload.php'; $obj_client = new \Venditan\Rapport\Client('test', 'api-key-goes-here-121gw'); $obj_client->addMessage()->title('Order Update')->body('Hi Marty. I have your order ready to ship.')->from('Emmett'); $obj_client->event('service_message')->send();