Releases: vapor-community/VaporTwilioService
Releases · vapor-community/VaporTwilioService
Support for Vapor 4
Escape Message Bodies
Message bodies are now escaped
Vapor Hotfix Hotfix
Merge pull request #5 from MihaelIsaev/master Fix client.post call
Renamed Targets
The target names being used for the example app were clashing with folks projects. Should be fine now.
Handling Incoming Texts
Handling Incoming Texts
After setting up the necessary routing within your Twilio account, you may create routes to handle and respond to incoming texts.
router.post("incoming") { (req) -> Response in
// This object will give you access to all of the properties of incoming texts
let sms = try req.content.syncDecode(IncomingSMS.self)
let twilio = try req.make(Twilio.self)
// You may respond with as many texts as you'd like
let responseMessage = SMSResponse(
Message(body: "Hello Friend!"),
Message(body: "This is a second text.")
)
return twilio.respond(with: responseMessage, on: req)
}
Updated docs and cleaned up Mailgun refrences
Thanks to @mergesort for pointing out the Mailgun reference
Initial Release
This one supports sending texts