File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 44
55use  BinaryBuilds \LaravelMailManager \Models \MailManagerMail ;
66use  Illuminate \Contracts \Queue \ShouldQueue ;
7+ use  Illuminate \Notifications \AnonymousNotifiable ;
78
89/** 
910 * Class NotificationManager 
@@ -26,9 +27,18 @@ public static function handleMailSendingEvent( $event )
2627            ]);
2728        }
2829        else  {
30+             $ recipients
31+             if ( $ eventnotifiable  instanceof  AnonymousNotifiable ) {
32+                 if ( is_array ($ eventnotifiable ->routes ) ) {
33+                     $ recipientsarray_values ($ eventnotifiable ->routes );
34+                 }
35+             } else  {
36+                 $ recipients$ eventnotifiable ->routeNotificationFor ('mail ' ) ];
37+             }
38+ 
2939            MailManagerMail::create ([
3040                'uuid '  => $ eventnotification ->id ,
31-                 'recipients '  =>   array_values ( $ event -> notifiable -> routes ) ,
41+                 'recipients '  => $ recipients 
3242                'subject '   =>$ eventnotification ->toMail ($ eventnotifiable )->subject ,
3343                'mailable_name '  => get_class ($ eventnotification ),
3444                'mailable '  => serialize (clone  $ eventnotification ),
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments