ameliabooking
/
src
/
Application
/
Controller
/
Notification
/
SendUndeliveredNotificationsController.php
GetNotificationsController.php
1 month ago
GetSMSNotificationsHistoryController.php
1 month ago
SendAmeliaSmsApiRequestController.php
1 month ago
SendTestEmailController.php
1 month ago
SendUndeliveredNotificationsController.php
1 month ago
UpdateNotificationController.php
1 month ago
UpdateNotificationStatusController.php
1 month ago
UpdateSMSNotificationHistoryController.php
1 month ago
UpdateSMSNotificationHistoryDirectlyController.php
1 month ago
ValidateSMTPCredentialsController.php
1 month ago
SendUndeliveredNotificationsController.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Application\Controller\Notification; |
| 4 | |
| 5 | use AmeliaBooking\Application\Commands\Notification\SendUndeliveredNotificationsCommand; |
| 6 | use AmeliaBooking\Application\Controller\Controller; |
| 7 | use RuntimeException; |
| 8 | use AmeliaVendor\Psr\Http\Message\ServerRequestInterface as Request; |
| 9 | |
| 10 | /** |
| 11 | * Class SendUndeliveredNotificationsController |
| 12 | * |
| 13 | * @package AmeliaBooking\Application\Controller\Notification |
| 14 | */ |
| 15 | class SendUndeliveredNotificationsController extends Controller |
| 16 | { |
| 17 | /** |
| 18 | * Instantiates the Send Undelivered Notifications command to hand it over to the Command Handler |
| 19 | * |
| 20 | * @param Request $request |
| 21 | * @param $args |
| 22 | * |
| 23 | * @return SendUndeliveredNotificationsCommand |
| 24 | * @throws RuntimeException |
| 25 | */ |
| 26 | protected function instantiateCommand(Request $request, $args) |
| 27 | { |
| 28 | $command = new SendUndeliveredNotificationsCommand($args); |
| 29 | |
| 30 | $requestBody = $request->getParsedBody(); |
| 31 | $this->setCommandFields($command, $requestBody); |
| 32 | |
| 33 | return $command; |
| 34 | } |
| 35 | } |
| 36 |