1 Answer
- Newest
- Most votes
- Most comments
0
I found that the following works for sending the text message.
Public Function Send(sendMessage As SendMessageInfo) As String Implements ISendMessage.Send
Dim strReturn As String = String.Empty
Dim strAppID As String = "abcdef123456" 'Pinpoint Project ID in the AWS console (not Project Name)
Dim ppGetEndpointResponse As New GetEndpointResponse
Dim ppEndpointResponse As EndpointResponse = ppGetEndpointResponse.EndpointResponse
Dim ppDirectMessageConfiguration As New DirectMessageConfiguration With {
.SMSMessage = New SMSMessage With {
.Body = sendMessage.Message,
.MessageType = MessageType.PROMOTIONAL
}
}
Dim ppAddressConfiguration As New AddressConfiguration With {
.ChannelType = ChannelType.SMS
}
Dim ppMessageRequest As New MessageRequest With {
.MessageConfiguration = ppDirectMessageConfiguration,
.Addresses = New Dictionary(Of String, AddressConfiguration) From {{sendMessage.PhoneNumber, ppAddressConfiguration}}
}
Dim ppSendMessagesRequest As New SendMessagesRequest With {
.ApplicationId = strAppID,
.MessageRequest = ppMessageRequest
}
Using ppClient As New AmazonPinpointClient
strReturn = ppClient.SendMessages(ppSendMessagesRequest).HttpStatusCode.ToString
End Using
Return strReturn
End Function
answered 5 years ago
Relevant content
- asked 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago