@@ -23,10 +23,21 @@ public function send($notifiables, $notification)
23
23
return ;
24
24
}
25
25
26
+ $ watchers = $ notifiables ['watchers ' ];
27
+ $ notifiables = $ notifiables ['notifiableUsers ' ];
28
+
26
29
$ notifiables = $ this ->notifiables ($ notifiables , $ notificationType );
30
+ $ notifiables = $ notifiables ->concat ($ watchers );
31
+ $ notifiables = $ notifiables ->unique (function ($ item ) {
32
+ return $ item ['email ' ];
33
+ });
27
34
28
35
(new NotificationSender (
29
- $ this , $ this ->container ->make (Bus::class), $ this ->container ->make (Dispatcher::class), $ this ->locale )
36
+ $ this ,
37
+ $ this ->container ->make (Bus::class),
38
+ $ this ->container ->make (Dispatcher::class),
39
+ $ this ->locale
40
+ )
30
41
)->send ($ notifiables , $ notification );
31
42
}
32
43
@@ -45,11 +56,22 @@ public function sendNow($notifiables, $notification, array $channels = null)
45
56
if (! NotificationType::isEnabled ($ notificationType )) {
46
57
return ;
47
58
}
59
+ $ watchers = $ notifiables ['watchers ' ];
60
+ $ notifiables = $ notifiables ['notifiableUsers ' ];
48
61
49
62
$ notifiables = $ this ->notifiables ($ notifiables , $ notificationType );
50
63
64
+ $ notifiables = $ notifiables ->concat ($ watchers );
65
+ $ notifiables = $ notifiables ->unique (function ($ item ) {
66
+ return $ item ['email ' ];
67
+ });
68
+
51
69
(new NotificationSender (
52
- $ this , $ this ->container ->make (Bus::class), $ this ->container ->make (Dispatcher::class), $ this ->locale )
70
+ $ this ,
71
+ $ this ->container ->make (Bus::class),
72
+ $ this ->container ->make (Dispatcher::class),
73
+ $ this ->locale
74
+ )
53
75
)->sendNow ($ notifiables , $ notification , $ channels );
54
76
}
55
77
@@ -65,6 +87,9 @@ public static function notifiables($notifiables, $notificationType)
65
87
$ notifiables ->load ('notificationSettings ' );
66
88
67
89
return $ notifiables ->filter (function ($ notifiable ) use ($ notificationType ) {
90
+ if ($ notificationType == 'App\Notifications\InstanceInvite ' ) {
91
+ return true ;
92
+ }
68
93
return $ notifiable ->canReceive ($ notificationType );
69
94
});
70
95
}
0 commit comments