Add Notification class to DocumentReminded event
This commit is contained in:
		@@ -3,7 +3,6 @@
 | 
			
		||||
namespace App\Listeners\Document;
 | 
			
		||||
 | 
			
		||||
use App\Events\Document\DocumentRecurring as Event;
 | 
			
		||||
use App\Notifications\Sale\Invoice as Notification;
 | 
			
		||||
 | 
			
		||||
class SendDocumentRecurringNotification
 | 
			
		||||
{
 | 
			
		||||
@@ -16,10 +15,11 @@ class SendDocumentRecurringNotification
 | 
			
		||||
    public function handle(Event $event)
 | 
			
		||||
    {
 | 
			
		||||
        $document = $event->document;
 | 
			
		||||
        $notification = $event->notification;
 | 
			
		||||
 | 
			
		||||
        // Notify the customer
 | 
			
		||||
        if ($document->contact && !empty($document->contact_email)) {
 | 
			
		||||
            $document->contact->notify(new Notification($document, "{$document->type}_recur_customer"));
 | 
			
		||||
            $document->contact->notify(new $notification($document, "{$document->type}_recur_customer"));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Notify all users assigned to this company
 | 
			
		||||
@@ -28,7 +28,7 @@ class SendDocumentRecurringNotification
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $user->notify(new Notification($document, "{$document->type}_recur_admin"));
 | 
			
		||||
            $user->notify(new $notification($document, "{$document->type}_recur_admin"));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user