Basic (Very basic) implementation of the fire text API.

[https://www.firetext.co.uk/docs#sendingsms](https://www.firetext.co.uk/docs#sendingsms)

Not to be merged. This API has a limit on it at the moment that will need to be removed before it is used in anger.
This commit is contained in:
Martyn Inglis
2016-02-17 12:57:51 +00:00
parent 58ae041b64
commit 226459132a
4 changed files with 62 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
from app import notify_celery, twilio_client, encryption
from app import notify_celery, twilio_client, encryption, firetext_client
from app.clients.sms.twilio import TwilioClientException
from app.dao.templates_dao import get_model_templates
from app.dao.notifications_dao import save_notification
@@ -24,6 +24,7 @@ def send_sms(service_id, notification_id, encrypted_notification):
try:
twilio_client.send_sms(notification['to'], template.content)
firetext_client.send_sms(notification['to'], template.content)
except TwilioClientException as e:
current_app.logger.debug(e)
save_notification(notification_db_object, {"status": "failed"})