66 lines
2.7 KiB
PHP
66 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\MailVersands\Tables;
|
|
|
|
use App\Actions\SendMail\SendNewsletter;
|
|
use Filament\Actions\Action;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\SelectColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class MailVersandsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('name')->label('Benennung'),
|
|
SelectColumn::make('mail_gruppen_id')
|
|
->optionsRelationship(name: 'mail_gruppen', titleAttribute: 'name')
|
|
->label('Versand an Gruppe'),
|
|
SelectColumn::make('mail_vorlage_id')
|
|
->optionsRelationship(name: 'mail_vorlage', titleAttribute: 'titel')
|
|
->label('Vorlage'),
|
|
// TextColumn::make('sende_zeitpunkt')
|
|
// ->alignCenter()
|
|
// ->since()
|
|
// ->badge()
|
|
// ->dateTimeTooltip()
|
|
// ->label('Sende Zeitpunkt'),
|
|
// TextColumn::make('versand_am')
|
|
// ->alignCenter()
|
|
// ->since()
|
|
// ->badge()
|
|
// ->dateTimeTooltip(),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->recordActions([
|
|
// Action::make('sendmail-bytime')
|
|
// ->tooltip('Sende zum Zeitpunkt')
|
|
// ->modalHeading('Newsletter Versand')
|
|
// ->icon('heroicon-o-envelope')
|
|
// ->modalDescription('E-Mails werden gelisted und zum gewählten Datum versandt.')
|
|
// ->requiresConfirmation()
|
|
// ->modalSubmitActionLabel('Senden')
|
|
// ->iconButton()
|
|
// ->modalIcon('heroicon-o-paper-airplane')
|
|
// ->action(fn ($record) => SendNewsletter::mailit($record)),
|
|
Action::make('sendmail-now')
|
|
->tooltip('Sende Jetzt')
|
|
->modalHeading('Newsletter Versand')
|
|
->icon('heroicon-o-paper-airplane')
|
|
->modalDescription('E-Mails werden gelisted und zum gewählten Datum versandt.')
|
|
->requiresConfirmation()
|
|
->modalSubmitActionLabel('Senden')
|
|
->iconButton()
|
|
->modalIcon('heroicon-o-paper-airplane')
|
|
->action(fn ($record) => SendNewsletter::mailit($record)),
|
|
EditAction::make()->iconButton()
|
|
->tooltip('Newsletter Einstellungen'),
|
|
]);
|
|
}
|
|
}
|