Created
April 24, 2011 20:28
-
-
Save jgable/939852 to your computer and use it in GitHub Desktop.
TextController.cs - An example SMS Responder Controller for MVC 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using _8Ball.Common; | |
using TwilioSharp.MVC3.Controllers; | |
using TwilioSharp.Request; | |
public class TextController : TwiMLController | |
{ | |
[HttpPost] | |
public ActionResult New(TextRequest request) | |
{ | |
var answer = "The Magical 8-Ball Says: " + Magic8BallAnswerizer3000.GetAnswer(); | |
return TwiML(response => response | |
.Sms(answer)); | |
// Alternatively: | |
//return TwiMLBuilder | |
// .Build() | |
// .Sms(answer) | |
// .ToTwiMLResult(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment