twosuperior/textmarketer

Unofficial Package for Official Text Marketer Rest Client

This package's canonical repository appears to be gone and the package has been frozen as a result.

dev-master 2015-08-11 14:15 UTC

This package is auto-updated.

Last update: 2024-02-26 17:49:19 UTC


README

TextMarketer's PHP SDK for easy integration between your app and our SMS messaging REST API.

Example

// REPLACE with your Text Marketer API username and password
$client = new \TextMarketer\Client('myuser', 'mypass', 'production');

try {
	
	$credits = $client->getCredits();
	echo "I have $credits credits.<br />\n";

	if ($credits > 0)
		$result = $client->sendSMS('Hello SMS World!', '447777777777', 'My Name');
	
	echo "Used {$result['credits_used']} credits, message ID {$result['message_id']}, scheduled ID {$result['scheduled_id']}<br /><br />\n"; 
	
} catch (Exception $ex) {
	// handle a possible error
	echo "An error occurred: {$ex->getCode()}, {$ex->getMessage()}";
}