Class SnsSmsTemplate

java.lang.Object
io.awspring.cloud.sns.sms.SnsSmsTemplate
All Implemented Interfaces:
SnsSmsOperations

public class SnsSmsTemplate extends Object implements SnsSmsOperations
Helper class abstraction over SnsClient tailored for sending SMS messages to SNS topics and phone numbers.
Since:
3.0.0
Author:
Matej Nedic
  • Constructor Details

    • SnsSmsTemplate

      public SnsSmsTemplate(software.amazon.awssdk.services.sns.SnsClient snsClient)
  • Method Details

    • send

      public void send(String phoneNumber, String message, @Nullable SmsMessageAttributes attributes)
      Description copied from interface: SnsSmsOperations
      Sends SMS directly to a phone number without a need for a phone number to be subscribed to an SNS topic.
      Specified by:
      send in interface SnsSmsOperations
      Parameters:
      phoneNumber - - phone number to receive a message in E.164 format (for example +14155552671)
      message - - content of the SMS
      attributes - - the message attributes
    • sendToTopicArn

      public void sendToTopicArn(String topicArn, String message, @Nullable SmsMessageAttributes attributes)
      Description copied from interface: SnsSmsOperations
      Sends SMS to a topic to which phone numbers are subscribed.
      Specified by:
      sendToTopicArn in interface SnsSmsOperations
      Parameters:
      topicArn - - the topic ARN
      message - - content of the SMS
      attributes - - the message attributes