Skip to content

Instantly share code, notes, and snippets.

@mbmccormick
Created October 9, 2011 01:15
Show Gist options
  • Save mbmccormick/1273141 to your computer and use it in GitHub Desktop.
Save mbmccormick/1273141 to your computer and use it in GitHub Desktop.
Telephony Made Easy with Twilio (Part 3)
def post(self):
alarm = Remindable.get_by_id(int(self.request.get('id')))
try:
self.response.headers["Content-Type"] = "text/xml"
self.response.out.write("<?xml version='1.0' encoding='UTF-8' ?>\n")
self.response.out.write("<Response&gt;&quot;)
self.response.out.write("<Say>Your remindable has arrived! " + alarm.text + "</Say>")
self.response.out.write("</Response>")
alarm.delete()
except Exception, detail:
self.response.out.write('An error occurred while sending a Remindable.\n\nException: %s' % detail)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment