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) {