def queue_send_message(email, number, subject, body): """ Celery task to send messages out in sms and email. """ if number: send_sms(to_number=number, body=body) message = Message(body=body, subject=subject, recipients=[email]) mailer.send(message)
def twillio_test(number=None): """Quick sms test to make sure twillio is functioning as expected.""" from _15thnight.twilio_client import send_sms with app.app_context(): # This default test number will force twillio to fail, but still be # a valid api call if not number: phone_number = app.config.get("TWILIO_TEST_NUMBER", "2125553456") else: phone_number = number send_sms(phone_number, "Are we operational?")