added sms delivery status callback

This commit is contained in:
venusbb
2017-12-01 20:30:53 +00:00
parent 489f43a2c9
commit a604fb82bb
4 changed files with 49 additions and 12 deletions

View File

@@ -8,7 +8,8 @@ from app.dao import notifications_dao
from app.clients.sms.firetext import get_firetext_responses
from app.clients.sms.mmg import get_mmg_responses
from app.celery.statistics_tasks import create_outcome_notification_statistic_tasks
from app.celery.service_callback_tasks import send_delivery_status_to_service
from app.config import QueueNames
sms_response_mapper = {
'MMG': get_mmg_responses,
@@ -83,5 +84,7 @@ def process_sms_client_response(status, reference, client_name):
create_outcome_notification_statistic_tasks(notification)
send_delivery_status_to_service.apply_async([notification.id], queue=QueueNames.NOTIFY)
success = "{} callback succeeded. reference {} updated".format(client_name, reference)
return success, errors