command for sending bulk sms with tests

This commit is contained in:
2022-06-14 01:15:58 +02:00
parent 4c0fef4f44
commit 28c952521f
15 changed files with 616 additions and 44 deletions

View File

@@ -15,6 +15,10 @@ use libphonenumber\PhoneNumber;
class ShortMessage
{
public const PRIORITY_LOW = 'low';
public const PRIORITY_MEDIUM = 'medium';
private string $content;
private PhoneNumber $phoneNumber;

View File

@@ -0,0 +1,32 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Service\ShortMessage;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* @AsMessageHandler
*/
class ShortMessageHandler implements MessageHandlerInterface
{
private ShortMessageTransporterInterface $messageTransporter;
public function __construct(ShortMessageTransporterInterface $messageTransporter)
{
$this->messageTransporter = $messageTransporter;
}
public function __invoke(ShortMessage $message): void
{
$this->messageTransporter->send($message);
}
}