Example of Sending SMS in PHP Using AWS SNS

$client = AWS::createClient('Sns');
$sms = [
    'Message' => 'sms_content',
    'PhoneNumber' => 'sms_recipient',
    'MessageAttributes' => [
        'AWS.SNS.SMS.SenderID' => [
            'DataType' => 'String',
            'StringValue' => 'AD'
        ],
        'AWS.SNS.SMS.SMSType' => [
            'DataType' => 'String',
            'StringValue' => 'Transactional'
        ],
    ]
];
$result = $client->publish($sms);

Leave a Reply