-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathamazon-aws-sms.php
37 lines (37 loc) · 1.01 KB
/
amazon-aws-sms.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
* @Name: PHP SMS Amazon SNS AWS
* @Repository: /~https://github.com/BaseMax/PHPSMSAmazonAWS
* @Description: A quick example of sending SMS with AWS SNS Using Amazon Service.
* @Author: Max Base
* @Date: 2020-09-20
*/
require './vendor/autoload.php';
$KEY='';
$SECRET='';
$parameters = [
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'secret' => $SECRET,
'key' => $KEY,
],
];
$sns = new \Aws\Sns\SnsClient($parameters);
$arguments = [
"MessageAttributes" => [
'AWS.SNS.SMS.SMSType' => [
'DataType' => 'String',
'StringValue' => 'Transactional'
],
'AWS.SNS.SMS.SenderID' => [
'DataType' => 'String',
'StringValue' => 'GitHub'
],
],
"Message" => "Hi,\nGood news for the Open Source Friday coming soon.\nWith kind regards,\nThe GitHub Open Source Team,\nMax Base",
"PhoneNumber" => "46720252169",
];
$result = $sns->publish($arguments);
var_dump($result);
print_r($result);