mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
command for sending bulk sms with tests
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user