30Jun/160
Send SMS using AWS SNS
Usually I go with Twillio for sending SMS but AWS has a cheaper and easier solution for this.
Here is the code to send a sms using AWS SNS
First thing install aws/aws-sdk-php package
require __DIR__.'/../vendor/autoload.php';
use Aws\Sns\SnsClient;
$client = SnsClient::factory([ 'credentials' => [ 'key' => 'your key', 'secret' => 'your secret', ], 'region' => 'us-west-2', 'version' => "latest" ]); $sent = $client->publish( [ 'Message' => 'This is the message', 'PhoneNumber' => '+123344545', 'MessageAttributes' => [ 'AWS.SNS.SMS.SenderID' => [ 'DataType' => 'String', 'StringValue' => 'The sender' ] ] ] );