For some reason the SenderID seems to revert to NOTICE - see here when I set the SenderID in the code.
When I leave the SenderID variable out, it sends as the default set - this is good, but we will be occasionally changing the name for different uses.
I am using the Official PHP SDK, with the code below:
$aws_cred = array(
'credentials' => array(
'key' => 'GOT THE KEY',
'secret' => 'GOT THE SECRET',
),
'region' => 'eu-west-1', // < your aws from SNS Topic region
'version' => 'latest'
);
$sns = new \Aws\Sns\SnsClient($aws_cred);
$args = array(
"SenderID" => "MySendID",
"SMSType" => "Promotional",
"Message" => "Amazon y u do dis??",
"PhoneNumber" => "+number"
);
$result = $sns->publish($args);
I am sending to the UK (so SID works there), and also it is within the 11 character limit.
Does anyone have any idea why this is happening?
Cheers
I have found the answer.
The search system didn't materialise this originally, but finally, I have found it.
QUOTE FROM: https://stackoverflow.com/a/43748448/7586984
I found the solution. Set the args this way. It works!
$args = array( 'MessageAttributes' => [ 'AWS.SNS.SMS.SenderID' => [ 'DataType' => 'String', 'StringValue' => 'YourSenderName' ] ], "SMSType" => "Transactional", "PhoneNumber" => "+87654321", "Message" => "Hello World!" );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With