Use MMG client for send-sms

This commit is contained in:
Rebecca Law
2016-04-06 15:56:34 +01:00
parent e8d5a9292a
commit 323b2ff537
3 changed files with 31 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ from sqlalchemy.exc import SQLAlchemyError
from app.clients.email.aws_ses import AwsSesClientException
from app.clients.sms.firetext import FiretextClientException
from app.clients.sms.mmg import MMGClientException
from app.dao.services_dao import dao_fetch_service_by_id
from app.dao.templates_dao import dao_get_template_by_id
@@ -198,7 +199,7 @@ def remove_job(job_id):
def send_sms(service_id, notification_id, encrypted_notification, created_at):
notification = encryption.decrypt(encrypted_notification)
service = dao_fetch_service_by_id(service_id)
client = firetext_client
client = mmg_client
restricted = False
@@ -239,7 +240,7 @@ def send_sms(service_id, notification_id, encrypted_notification, created_at):
content=template.replaced,
reference=str(notification_id)
)
except FiretextClientException as e:
except MMGClientException as e:
current_app.logger.error(
"SMS notification {} failed".format(notification_id)
)

View File

@@ -42,7 +42,7 @@ class MMGClient(SmsClient):
super(SmsClient, self).__init__(*args, *kwargs)
self.api_key = config.get('MMG_API_KEY')
self.from_number = config.get('NOTIFY_FROM_NUMBER')
self.name = 'mmg'
self.name = 'MMG'
def get_name(self):
return self.name