Send status report

This commit is contained in:
Marko Jovanovic 2025-10-14 14:39:42 +02:00
parent 849f97d56a
commit 533c7f533e
3 changed files with 7 additions and 2 deletions

1
.env
View File

@ -35,4 +35,5 @@ DEFAULT_URI=http://localhost
DATABASE_URL="postgresql://postgres:idm2022IDM@127.0.0.1:5440/sms_scheduler?serverVersion=16&charset=utf8" DATABASE_URL="postgresql://postgres:idm2022IDM@127.0.0.1:5440/sms_scheduler?serverVersion=16&charset=utf8"
SMS_GATEWAY_API_KEY=INSERTHERE SMS_GATEWAY_API_KEY=INSERTHERE
STATUS_NUMBER=123
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###

View File

@ -12,6 +12,7 @@ services:
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
bind: bind:
string $sms_gateway_api_key: '%env(SMS_GATEWAY_API_KEY)%' string $sms_gateway_api_key: '%env(SMS_GATEWAY_API_KEY)%'
string $status_number: '%env(STATUS_NUMBER)%'
# makes classes in src/ available to be used as services # makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name # this creates a service per class whose id is the fully-qualified class name

View File

@ -29,15 +29,18 @@ class ContactUncontactedCommand extends Command
private HttpClientInterface $httpClient; private HttpClientInterface $httpClient;
private string $sms_gateway_api_key; private string $sms_gateway_api_key;
private string $status_number;
public function __construct(EntityManagerInterface $entityManager, public function __construct(EntityManagerInterface $entityManager,
HttpClientInterface $httpClient, HttpClientInterface $httpClient,
string $sms_gateway_api_key) string $sms_gateway_api_key,
string $status_number)
{ {
parent::__construct(); parent::__construct();
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->httpClient = $httpClient; $this->httpClient = $httpClient;
$this->sms_gateway_api_key = $sms_gateway_api_key; $this->sms_gateway_api_key = $sms_gateway_api_key;
$this->status_number = $status_number;
} }
protected function configure(): void protected function configure(): void
@ -137,7 +140,7 @@ class ContactUncontactedCommand extends Command
], ],
'body': { 'body': {
'type': 'auto', 'type': 'auto',
'content': 'SMS-Versand-Update: Insg. {$countSent} versendet. Total versucht: {$countTotal}.' 'content': 'SMS-Versand-Update:\n\n Insg. {$countSent} versendet.\nTotal versucht: {$countTotal}.'
}, },
'minimumNumberOfMessageParts': 1, 'minimumNumberOfMessageParts': 1,
'maximumNumberOfMessageParts': 8, 'maximumNumberOfMessageParts': 8,