Class TwilioMessageClient
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.sms.TwilioMessageClient
Thin wrapper over the Twilio SDK, so the sender can be unit-tested with a mock.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
restClient
private final com.twilio.http.TwilioRestClient restClientClient holding the credentials. -
from
Sender number, ornullwhen a messaging service is used. -
messagingServiceSid
Messaging service SID, ornullwhen a sender number is used.
-
-
Constructor Details
-
TwilioMessageClient
Creates the client.- Parameters:
properties- credentials and sender.- Throws:
IllegalStateException- if the credentials or the sender are not configured.
-
-
Method Details
-
send
Sends a message.- Parameters:
to- recipient in E.164.text- text of the message.
-