]> _ Git - psq.git/commitdiff
Update DispatchMailgunEvent.php
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 07:48:06 +0000 (09:48 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 7 Sep 2020 07:48:06 +0000 (09:48 +0200)
app/Events/DispatchMailgunEvent.php

index 93c5f35738233c848f31d2525fb71e71737944e2..168ec0789e0ef001ca7412a0eb63e68bfc959e66 100644 (file)
@@ -39,22 +39,23 @@ class DispatchMailgunEvent implements ShouldBroadcast
         $tags = Arr::get($webhookData, 'event-data.tags');
 
 
+
+
         /** @todo check webhook key */
 
         $this->batch_id = Str::after(Arr::first($tags, function($tag) {
             return Str::startsWith($tag, 'batch_id_');
         }), 'batch_id_');
 
+        \Log::info('batch ' . $this->batch_id);
+
         $event = MailgunEvent::updateOrCreate([
             'event' => Arr::get($webhookData, 'event-data.event'),
             'recipient' => Arr::get($webhookData, 'event-data.recipient'),
             'email_batch_id' => $this->batch_id
         ]);
 
-        $this->broadcast = in_array(config('app.env'), $tags, true) &&
-            ($event->wasRecentlyCreated);
-
-        \Log::info("broadcast : " . ($this->broadcast ? "yes" : "no") . " " . config('app.env') . ' | ' . implode(',', $tags) . " | " );
+        $this->broadcast = ($event->wasRecentlyCreated);
 
 
         $event->touch();