Add SMS message sending to customer when JO is fulfilled via rider app. #464

This commit is contained in:
Korina Cordero 2020-08-12 05:35:36 +00:00
parent 28b939a969
commit 938ef24078

View file

@ -526,6 +526,15 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface
// save to customer vehicle battery record // save to customer vehicle battery record
$this->jo_handler->updateVehicleBattery($jo); $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(); $this->em->flush();
// create warranty // create warranty
@ -582,15 +591,6 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface
]; ];
$this->mclient->sendEvent($jo, $payload); $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; return $data;
} }