diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index f7a968f9a..00d99426f 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -115,7 +115,6 @@ class CalendarController extends AbstractController } #[Route(path: '/{_locale}/calendar/calendar/{id}/cancel', name: 'chill_calendar_calendar_cancel')] - public function cancelAction(Calendar $calendar, Request $request): Response { // Deal with sms being sent or not diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php index dfce0548c..991a3eda2 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php @@ -19,6 +19,7 @@ declare(strict_types=1); namespace Chill\CalendarBundle\Service\ShortMessageNotification; use Chill\CalendarBundle\Entity\Calendar; +use Chill\CalendarBundle\Entity\CancelReason; use libphonenumber\PhoneNumberFormat; use libphonenumber\PhoneNumberUtil; use Symfony\Component\Notifier\Message\SmsMessage; @@ -57,7 +58,7 @@ class DefaultShortMessageForCalendarBuilder implements ShortMessageForCalendarBu $this->phoneUtil->format($person->getMobilenumber(), PhoneNumberFormat::E164), $this->engine->render('@ChillCalendar/CalendarShortMessage/short_message.txt.twig', ['calendar' => $calendar]), ); - } elseif (Calendar::SMS_CANCEL_PENDING === $calendar->getSmsStatus()) { + } elseif (Calendar::SMS_CANCEL_PENDING === $calendar->getSmsStatus() && !(CancelReason::CANCELEDBY_PERSON === $calendar->getCancelReason()->getCanceledBy())) { $toUsers[] = new SmsMessage( $this->phoneUtil->format($person->getMobilenumber(), PhoneNumberFormat::E164), $this->engine->render('@ChillCalendar/CalendarShortMessage/short_message_canceled.txt.twig', ['calendar' => $calendar]),