Send status report
This commit is contained in:
parent
533c7f533e
commit
d882308799
|
|
@ -123,8 +123,10 @@ class ContactUncontactedCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->status_number) {
|
||||
$io->info('Sending status message...');
|
||||
try {
|
||||
$responseStatus = $this->httpClient->request('POST', self::$apiEndpoint, [
|
||||
$this->httpClient->request('POST', self::$apiEndpoint, [
|
||||
'headers' => [
|
||||
'X-CM-PRODUCTTOKEN' => $this->sms_gateway_api_key,
|
||||
'Accept' => 'application/json',
|
||||
|
|
@ -136,7 +138,7 @@ class ContactUncontactedCommand extends Command
|
|||
'allowedChannels': ['SMS'],
|
||||
'from': 'UKB',
|
||||
'to': [
|
||||
{ 'number': '004917672121270' }
|
||||
{ 'number': '{$this->status_number}' }
|
||||
],
|
||||
'body': {
|
||||
'type': 'auto',
|
||||
|
|
@ -149,9 +151,9 @@ class ContactUncontactedCommand extends Command
|
|||
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
$io->error(sprintf('An error occurred contacting the API for number %s: %s', '004917672121270', $e->getMessage()));
|
||||
$io->error(sprintf('An error occurred contacting the API for number %s: %s', $this->status_number, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Finalize all database changes
|
||||
$this->entityManager->flush();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user