From 938ef240781fe1b7f6d017d0cf46ec97cd334166 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 12 Aug 2020 05:35:36 +0000 Subject: [PATCH] Add SMS message sending to customer when JO is fulfilled via rider app. #464 --- .../RiderAPIHandler/ResqRiderAPIHandler.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Service/RiderAPIHandler/ResqRiderAPIHandler.php b/src/Service/RiderAPIHandler/ResqRiderAPIHandler.php index 5f6a920f..4a86ceba 100644 --- a/src/Service/RiderAPIHandler/ResqRiderAPIHandler.php +++ b/src/Service/RiderAPIHandler/ResqRiderAPIHandler.php @@ -526,6 +526,15 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface // save to customer vehicle battery record $this->jo_handler->updateVehicleBattery($jo); + // send SMS to customer + $phone_number = $jo->getCustomer()->getPhoneMobile(); + if (!empty($phone_number)) + { + // TODO: put this in config file or somewhere + $message = "Your Resq job order has been completed."; + $this->rt->sendSMS($phone_number, 'MOTOLITE', $message); + } + $this->em->flush(); // create warranty @@ -582,15 +591,6 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface ]; $this->mclient->sendEvent($jo, $payload); - // send SMS to customer - $phone_number = $jo->getCustomer()->getPhoneMobile(); - if (!empty($phone_number)) - { - // TODO: put this in config file or somewhere - $message = "Your Resq job order has been completed."; - $this->rt->sendSMS($phone_number, 'MOTOLITE', $message); - } - return $data; }