Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active January 17, 2018 17:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save niraj-shah/d0f74825188ec1be47adaee59be82c96 to your computer and use it in GitHub Desktop.
Using AWS SNS to send SMS messages
<?php
require 'vendor/autoload.php';
$sdk = new Aws\Sns\SnsClient([
'region' => 'eu-west-1',
'version' => 'latest',
'credentials' => ['key' => 'xxx', 'secret' => 'xxx']
]);
$result = $sdk->publish([
'Message' => 'This is a test message.',
'PhoneNumber' => '+4401234567890',
'MessageAttributes' => ['AWS.SNS.SMS.SenderID' => [
'DataType' => 'String',
'StringValue' => 'WebNiraj'
]
]]);
print_r( $result );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment