From 6f7cb5ee559fc75e36d51c16abbccfc822f60ea5 Mon Sep 17 00:00:00 2001 From: Misha Golenkov Date: Tue, 21 Oct 2025 13:36:25 +1100 Subject: [PATCH] MDL-86970 core_sms: Remove dedicated SetSMSAttributes call for AWS SNS --- .../aws/classes/local/service/aws_sns.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/public/sms/gateway/aws/classes/local/service/aws_sns.php b/public/sms/gateway/aws/classes/local/service/aws_sns.php index f1654c91132..cfbf72563eb 100644 --- a/public/sms/gateway/aws/classes/local/service/aws_sns.php +++ b/public/sms/gateway/aws/classes/local/service/aws_sns.php @@ -69,18 +69,19 @@ class aws_sns implements aws_sms_service_provider { $senderid = substr($senderid, 0, 11); try { - // These messages need to be transactional. - $client->SetSMSAttributes([ - 'attributes' => [ - 'DefaultSMSType' => 'Transactional', - 'DefaultSenderID' => $senderid, - ], - ]); - - // Actually send the message. $client->publish([ 'Message' => $messagecontent, 'PhoneNumber' => $phonenumber, + 'MessageAttributes' => [ + 'AWS.SNS.SMS.SenderID' => [ + 'DataType' => 'String', + 'StringValue' => $senderid, + ], + 'AWS.SNS.SMS.SMSType' => [ + 'DataType' => 'String', + 'StringValue' => 'Transactional', + ], + ], ]); return \core_sms\message_status::GATEWAY_SENT; } catch (\Aws\Exception\AwsException $e) {