Package io.awspring.cloud.sns.sms
Class SnsSmsTemplate
java.lang.Object
io.awspring.cloud.sns.sms.SnsSmsTemplate
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
send
(String phoneNumber, String message, SmsMessageAttributes attributes) Sends SMS directly to a phone number without a need for a phone number to be subscribed to an SNS topic.void
sendToTopicArn
(String topicArn, String message, SmsMessageAttributes attributes) Sends SMS to a topic to which phone numbers are subscribed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.awspring.cloud.sns.sms.SnsSmsOperations
send, sendToTopicArn
-
Constructor Details
-
SnsSmsTemplate
public SnsSmsTemplate(software.amazon.awssdk.services.sns.SnsClient snsClient)
-
-
Method Details
-
send
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 interfaceSnsSmsOperations
- Parameters:
phoneNumber
- - phone number to receive a message in E.164 format (for example +14155552671)message
- - content of the SMSattributes
- - 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 interfaceSnsSmsOperations
- Parameters:
topicArn
- - the topic ARNmessage
- - content of the SMSattributes
- - the message attributes
-