mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 09:05:01 +00:00
Replace custom ShortMessage usage with Symfony’s SmsMessage.
Switched the entire short message notification system to leverage Symfony's Notifier component and its TexterInterface with SmsMessage. This update simplifies the implementation, removes custom short message handling, and aligns with Symfony's standardized approach.
This commit is contained in:
@@ -21,11 +21,17 @@ namespace Chill\CalendarBundle\Service\ShortMessageNotification;
|
||||
use Chill\CalendarBundle\Entity\Calendar;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Messenger\MessageBusInterface;
|
||||
use Symfony\Component\Notifier\TexterInterface;
|
||||
|
||||
class BulkCalendarShortMessageSender
|
||||
{
|
||||
public function __construct(private readonly CalendarForShortMessageProvider $provider, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MessageBusInterface $messageBus, private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder) {}
|
||||
public function __construct(
|
||||
private readonly CalendarForShortMessageProvider $provider,
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly TexterInterface $texter,
|
||||
private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder,
|
||||
) {}
|
||||
|
||||
public function sendBulkMessageToEligibleCalendars()
|
||||
{
|
||||
@@ -36,7 +42,7 @@ class BulkCalendarShortMessageSender
|
||||
$smses = $this->messageForCalendarBuilder->buildMessageForCalendar($calendar);
|
||||
|
||||
foreach ($smses as $sms) {
|
||||
$this->messageBus->dispatch($sms);
|
||||
$this->texter->send($sms);
|
||||
++$countSms;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user