added email notification for TicketResource.php, add option to edit users - ban, unban
This commit is contained in:
@@ -198,6 +198,30 @@ class TicketResource extends Resource
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkAction::make('notify_users')
|
||||
->label('Send Email Notification')
|
||||
->color('success')
|
||||
->icon('heroicon-o-envelope')
|
||||
->requiresConfirmation()
|
||||
->deselectRecordsAfterCompletion()
|
||||
->action(function (\Illuminate\Support\Collection $records) {
|
||||
foreach ($records as $ticket) {
|
||||
$responses = $ticket->responses()
|
||||
->with('user')
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
|
||||
if ($ticket->user && $ticket->user->email) {
|
||||
\Illuminate\Support\Facades\Mail::to($ticket->user->email)
|
||||
->send(new \App\Mail\TicketResponseNotification($ticket, $responses));
|
||||
}
|
||||
}
|
||||
|
||||
\Filament\Notifications\Notification::make()
|
||||
->title('Email notifications sent successfully!')
|
||||
->success()
|
||||
->send();
|
||||
}),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user