def sms(request): """ Handle all incoming messages from Twilio. This is the start of the message processing pipeline. """ r = twiml.Response() msg = InboundSms(request.POST) msg.start_bg_tasks() config = SiteConfiguration.get_solo() if not config.disable_all_replies: r.message(msg.reply) return r
def sms(request): """ Handle all incoming messages from Twilio. This is the start of the message processing pipeline. """ logger.info('Received new sms') r = twiml.Response() msg = InboundSms(request.POST) msg.start_bg_tasks() config = SiteConfiguration.get_solo() if msg.reply and not config.disable_all_replies: logger.info('Add reply (%s) to response', msg.reply) r.message(msg.reply) logger.info('Return response to Twilio') return r
def sms(request): """ Handle all incoming messages from Twilio. This is the start of the message processing pipeline. """ logger.info("Received new sms") r = MessagingResponse() msg = InboundSms(request.POST) msg.start_bg_tasks() config = SiteConfiguration.get_solo() if msg.reply and not config.disable_all_replies: logger.info("Add reply (%s) to response", msg.reply) r.message(msg.reply) logger.info("Return response to Twilio") return HttpResponse(str(r), content_type="application/xml")