mail versand wip
This commit is contained in:
1 parent
e1f7729add
commit
ebdf2e396a
32 files changed
+496
-28
No files matched your search
@@ -17,9 +17,11 @@ class MailVorlageResource extends Resource
|
||||
{
|
||||
protected static ?string $model = MailVorlage::class;
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
protected static ?string $cluster = NewsletterCluster::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText;
|
||||
|
||||
protected static ?string $navigationLabel = 'Mail Vorlagen';
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ class ListMailVorlages extends ListRecords
|
||||
{
|
||||
protected static string $resource = MailVorlageResource::class;
|
||||
|
||||
// protected function getTableRecordsPerPageSelectOptions(): array
|
||||
// {
|
||||
// return [1];
|
||||
// }
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Resources\MailVorlages\Schemas;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class MailVorlageForm
|
||||
{
|
||||
@@ -14,9 +15,9 @@ class MailVorlageForm
|
||||
->components([
|
||||
TextInput::make('titel')->suffix('Nur zur Kennung'),
|
||||
RichEditor::make('inhalt')
|
||||
->belowContent('Im Text konnen Vornamen und Nachnamen des Empfängers mit den Platzhaltern ###vorname### und ###nachname### ersetzen werden. Für die Anrede ###anrede### wird je nach Geschlecht "Sehr geehrte Frau" oder "Sehr geehrter Herr" verwended. Ansonnsten einfach "Hallo" verwenden.')
|
||||
->belowContent(new HtmlString('<div class="text-xs mx-5 py-4">Im Text können <b>Vornamen</b> und <b>Nachnamen</b> des Empfängers mit den Platzhaltern ###vorname### und ###nachname### ersetzen werden. <br>Für die <b>Anrede</b> wird der Platzhalter ###anrede### verwended. Dieser wird je nach Geschlecht durch "Sehr geehrte Frau" oder "Sehr geehrter Herr" ersetzt, oder einfach "Hallo" verwenden.</div>'))
|
||||
->toolbarButtons([
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
['bold', 'italic', 'underline', 'strike', 'code', 'small', 'highlight'],
|
||||
['undo', 'redo'],
|
||||
]),
|
||||
])->columns(1);
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use App\Models\MailVorlage;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class MailVorlagesTable
|
||||
{
|
||||
@@ -14,19 +17,40 @@ class MailVorlagesTable
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('titel'),
|
||||
TextColumn::make('inhalt')->html(),
|
||||
// TextColumn::make('titel'),
|
||||
TextColumn::make('inhalt')
|
||||
->label('E-Mail Vorlage')
|
||||
->extraAttributes(['class' => 'tiptap'])
|
||||
->html()
|
||||
->wrap(),
|
||||
])
|
||||
->paginated(false)
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
Filter::make('vorlagen_id')
|
||||
->schema([
|
||||
Select::make('vorlagen_id')
|
||||
->hiddenLabel()
|
||||
->preload()
|
||||
->default(1)
|
||||
->selectablePlaceholder(false)
|
||||
->options(function (): array {
|
||||
return MailVorlage::pluck('titel', 'id')->toArray();
|
||||
}),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query
|
||||
->when(
|
||||
$data['vorlagen_id'],
|
||||
fn (Builder $query, $vorlagen_id): Builder => $query->where('id', $vorlagen_id),
|
||||
);
|
||||
}),
|
||||
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->filtersResetActionPosition(null)
|
||||
->hiddenFilterIndicators()
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user