Skip to content

Instantly share code, notes, and snippets.

@EsendexDev
EsendexDev / InstallEsendexGemFromGemFile.gem
Created July 24, 2013 13:53
Installing the Esendex Ruby SDK RubyGem from your project's Gemfile
gem 'esendex'
@EsendexDev
EsendexDev / esendex.rb
Created July 24, 2013 14:01
Example config for the Esendex Ruby SDK
Esendex.configure do |config|
config.username = "<username>"
config.password = "<password>"
config.account_reference = "<account_reference>"
end
@EsendexDev
EsendexDev / SendingAMessage.rb
Created July 24, 2013 14:04
Sending a single message with the Esendex Ruby SDK
account = Account.new
batch_id = account.send_message( to: "07777111222", body: "Saying hello to the world with the help of Esendex")
@EsendexDev
EsendexDev / SendingMultipleMessages.rb
Created July 24, 2013 14:05
Sending multiple messages using the Esendex Ruby SDK
batch_id = account.send_messages([Message.new("07777111222", "Hello"), Message.new("07777111333", "Hi")])
@EsendexDev
EsendexDev / GetSentMessageBodies.cs
Last active December 22, 2015 17:59
Getting message body texts using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
const int pageNumber = 1;
const int pageSize = 20;
var credentials = new EsendexCredentials(USERNAME, PASSWORD);
var sentService = new SentService(credentials);
var messageBodyService = new MessageBodyService(credentials);
var sentMessages = sentService.GetMessages(pageNumber, pageSize);
foreach (var message in sentMessages.Messages)
@EsendexDev
EsendexDev / CreateAndSendSMS.php
Created November 6, 2013 11:15
Creating and Sending SMS messages using the Esendex PHP SDK - Full details here: http://developers.esendex.com/
$message = new \Esendex\Model\DispatchMessage(
"WebApp", // Send from
"01234567890", // Send to any valid number
"My Web App is SMS enabled!",
\Esendex\Model\Message::SmsType
);
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
@EsendexDev
EsendexDev / GetInboxMessage.php
Created November 6, 2013 11:28
Getting Inbox messages using the Esendex PHP SDK - Full details here: http://developers.esendex.com/
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
);
$service = new \Esendex\InboxService($authentication);
$result = $service->latest();
print "Total Inbox Messages: {$result->totalCount()}";
@EsendexDev
EsendexDev / TrackMessageStatus.php
Created November 6, 2013 11:59
Tracking the status of messages using the Esendex PHP SDK - Full details here: http://developers.esendex.com/
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex account reference
"[email protected]", // Your login email
"password" // Your password
);
$headerService = new \Esendex\MessageHeaderService($authentication);
$message = $headerService->message("messageId");
print_r($message->status());
@EsendexDev
EsendexDev / GetFullMessageBody.php
Created November 6, 2013 12:02
Getting message body texts using the Esendex PHP SDK - Full details here: http://developers.esendex.com/
$messageId = "unique-id-of-message";
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
);
$service = new \Esendex\MessageBodyService($authentication);
$result = $service->getMessageBodyById($messageId);
@EsendexDev
EsendexDev / RunPhingTests.sh
Created November 6, 2013 12:10
Running tests for the Esendex PHP SDK using the phing build utility for PHP
php phing-latest.phar