public class ShortMessage {
private Map smsAttributes;
public Map getDefaultSMSAttributes() {
if (smsAttributes == null) {
smsAttributes = new HashMap<>();
smsAttributes.put("AWS.SNS.SMS.SenderID", new MessageAttributeValue()
.withStringValue("1")
.withDataType("String"));
smsAttributes.put("AWS.SNS.SMS.MaxPrice", new MessageAttributeValue()
.withStringValue("0.05")
.withDataType("Number"));
smsAttributes.put("AWS.SNS.SMS.SMSType", new MessageAttributeValue()
.withStringValue("Transactional")
.withDataType("String"));
}
return smsAttributes;
}
public PublishResult sendSMSMessage(String phoneNumber, String message) {
return sendSMSMessage(phoneNumber, message, getDefaultSMS