def send_sms(): people = data_manager.read() if request.method == 'POST': message = request.json['message'] for person in people: info = person.split(',') if info[2] == 'True': num = info[1] twilio_send(message, num) return 'Success'
def call_number(): if request.method == 'POST': message = request.json['message'] with app.test_request_context(): url = 'http://triocast.herokuapp.com' + url_for('xml', msg=message) if (url): people = data_manager.read() for person in people: info = person.split(',') if info[3] == 'True': num = info[1] twilio_call(url, num) return "Call succeeded"