Last active
January 17, 2018 17:07
-
-
Save niraj-shah/d0f74825188ec1be47adaee59be82c96 to your computer and use it in GitHub Desktop.
Using AWS SNS to send SMS messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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