diff --git a/docroot/modules/custom/va_gov_post_api/src/EventSubscriber/QueueItemProcessedEventSubscriber.php b/docroot/modules/custom/va_gov_post_api/src/EventSubscriber/QueueItemProcessedEventSubscriber.php index f72899e8a6..2f6d41db38 100644 --- a/docroot/modules/custom/va_gov_post_api/src/EventSubscriber/QueueItemProcessedEventSubscriber.php +++ b/docroot/modules/custom/va_gov_post_api/src/EventSubscriber/QueueItemProcessedEventSubscriber.php @@ -116,6 +116,14 @@ public function onQueueItemProcessed(QueueItemProcessedEvent $event) { // The response might have been 200 from the TIC not the Facility API. $message = sprintf('Item %s Posted with a 200, but had an unexpected response with a size: %F phrase: %s', $item_data['uid'], $size, $response_phrase); $this->logger->get('va_gov_post_api')->warning($message); + + if ($this->moduleHandler->moduleExists('slack')) { + $slack_config = $this->config->get('slack.settings'); + if ($slack_config->get('slack_webhook_url')) { + $this->slack->sendMessage(':warning: ' . $message); + } + } + // Add the item that might not have been processed back to the queue. $this->postQueue->addToQueue($item_data); }