]> _ Git - psq.git/commitdiff
unsub
authorLouis Jeckel <louis.jeckel@outlook.com>
Wed, 16 Dec 2020 17:11:47 +0000 (18:11 +0100)
committerLouis Jeckel <louis.jeckel@outlook.com>
Wed, 16 Dec 2020 17:11:47 +0000 (18:11 +0100)
app/Events/DispatchMailgunEvent.php
app/User.php

index 77f7cd9c045745ea179ee09d376f8a3c79437f2f..55286675783ee8e250c3247f6e766cb21c09294a 100644 (file)
@@ -73,11 +73,8 @@ class DispatchMailgunEvent implements ShouldBroadcast
         $event->touch();
         $this->data = $event;
 
-        /**
-         * @todo track unsubscribes
-         */
         if($event->event === 'unsubscribed') {
-//            $event->user->unsubscribe();
+            $event->user->unsubscribe();
         }
 
 
index 81974e7b93b1cd8814f72814561aa910445d7282..02420d2384504afff6793d4acd289935986e03dd 100644 (file)
@@ -402,7 +402,7 @@ class User extends Authenticatable implements MustVerifyEmail, SendsEmails
      */
     public function scopeReceivesEmails(Builder $builder): void
     {
-        $builder->where('unsubscribed', '0');
+//        $builder->where('unsubscribed', '0');
         $builder->where(function($builder) {
 //            $builder->hasActiveSubscription()->orWhere->isOnTrial()->orWhere->isOnDiscovery();
             $builder->where('type', User::TYPE_SUBSCRIBER)->orWhere->isOnTrial()->orWhere->isOnDiscovery();