added email notification for TicketResource.php, add option to edit users - ban, unban

This commit is contained in:
Gitea
2025-05-18 21:50:24 +05:30
parent c00cad3cf1
commit b43461e180
10 changed files with 410 additions and 2 deletions

View File

@@ -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();
}),
]),
]);
}