From 3a8b62c75a9e22763977b0dc685ccefef60a326c Mon Sep 17 00:00:00 2001 From: Marko <52066939+HeX87@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:30:03 +0100 Subject: [PATCH] update slack msg --- src/EventSubscriber/SlackNotifySubscriber.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/EventSubscriber/SlackNotifySubscriber.php b/src/EventSubscriber/SlackNotifySubscriber.php index 85963f0..eef6e74 100644 --- a/src/EventSubscriber/SlackNotifySubscriber.php +++ b/src/EventSubscriber/SlackNotifySubscriber.php @@ -68,13 +68,10 @@ class SlackNotifySubscriber implements EventSubscriberInterface 'allow_markdown' => true, ]); - dd($item); - $msg = "Bestellung {$order->getOrderId()}: \n"; - $msg .= $item['marke'] . '-'; $msg .= $item['name']; - $msg .= '-' . $item['han']; - $msg .= ' - *' . $item['menge'] . "* \n"; + $msg .= ' ' . $item['sku']; + $msg .= ' Menge: ' . $item['menge'] . "\n"; if ($order->getStatus() == 1) { $slack->from('CDS-Notify')->send($msg); @@ -89,6 +86,10 @@ class SlackNotifySubscriber implements EventSubscriberInterface */ private function getWarehouseByGtin(string $gtin) { + if ($gtin == null) { + return false; + } + $product = $this->productRepository->findOneBy(['gtin' => $gtin]); if ($product) {