### Filament Mail Log Configuration Example Source: https://github.com/tappnetwork/filament-maillog/blob/2.x/README.md An example of the published configuration file for the Filament Mail Log plugin. It shows settings for Amazon SES, resource mapping, navigation, and sorting preferences. ```php return [ 'amazon-ses' => [ 'configuration-set' => null, ], 'resources' => [ 'MaiLogResource' => \Tapp\FilamentMailLog\Resources\MailLogResource::class, ], 'navigation' => [ 'maillog' => [ 'register' => true, 'sort' => 1, 'icon' => 'heroicon-o-rectangle-stack', ], ], 'sort' => [ 'column' => 'created_at', 'direction' => 'desc', ], ]; ``` -------------------------------- ### Amazon SES Integration Configuration (PHP & Bash) Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Guides through configuring Amazon SES to send delivery notifications to an application's SNS webhook endpoint. Includes .env configuration, route registration, and AWS CLI commands for creating SNS topics, subscribing endpoints, and configuring SES event destinations. ```php cc('manager@example.com') ->bcc('admin@example.com') ->send(new WelcomeEmail($user)); // Send raw email - automatically logged Mail::raw('This is a test email body', function ($message) { $message->to('user@example.com') ->subject('Test Email') ->from('noreply@example.com'); }); // Send with attachments - attachments are captured Mail::to('user@example.com') ->send(new WelcomeEmail($user)->attach('/path/to/file.pdf')); // The plugin automatically intercepts MessageSending event // and stores: from, to, cc, bcc, subject, body, headers, attachments ``` -------------------------------- ### Publish and Run Mail Log Migrations Source: https://github.com/tappnetwork/filament-maillog/blob/2.x/README.md Publishes the necessary migration files for the mail log database table and then runs the migrations to create the table. This is required for the plugin to store email logs. ```bash php artisan vendor:publish --tag="filament-maillog-migrations" php artisan migrate ``` -------------------------------- ### Query MailLog Model Programmatically Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Demonstrates how to interact with the MailLog model to retrieve, filter, and access data for outgoing emails, including delivery status and specific email fields. ```php orderBy('created_at', 'desc') ->get(); // Find bounced emails $bouncedEmails = MailLog::whereNotNull('bounced')->get(); // Find emails by status $deliveredEmails = MailLog::where('status', 'Delivery')->get(); // Get email with pretty-printed JSON data $log = MailLog::find(1); echo $log->data_json; // Returns formatted JSON string // Access specific fields $log = MailLog::first(); echo $log->from; // "sender@example.com" echo $log->to; // "recipient@example.com" echo $log->cc; // "cc@example.com" echo $log->bcc; // "bcc@example.com" echo $log->subject; // "Welcome to Our App" echo $log->body; // "..." echo $log->headers; // Full email headers echo $log->attachments; // Attachment data echo $log->message_id; // UUID for tracking echo $log->status; // "Delivery", "Bounce", "Complaint" echo $log->delivered; // Timestamp when delivered echo $log->bounced; // Timestamp when bounced echo $log->complaint; // Timestamp of complaint echo $log->opened; // Timestamp when opened ``` -------------------------------- ### Customizing Filament MailLogResource (PHP) Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Demonstrates how to extend the default MailLogResource in Filament to customize the admin interface. This includes adding new columns with specific formatting and search/sort capabilities, and configuring the plugin to use the custom resource. ```php columns([ TextColumn::make('status') ->badge() ->color(fn (string $state): string => match ($state) { 'Delivery' => 'success', 'Bounce' => 'danger', 'Complaint' => 'warning', default => 'gray', }), TextColumn::make('subject') ->searchable() ->sortable(), TextColumn::make('to') ->searchable(), TextColumn::make('created_at') ->dateTime() ->sortable(), ]); } } ``` ```php [ 'MaiLogResource' => \App\Filament\Resources\CustomMailLogResource::class, ], ]; ``` -------------------------------- ### Run Plugin Tests Source: https://github.com/tappnetwork/filament-maillog/blob/2.x/README.md Executes the test suite for the Filament Mail Log plugin using Composer. This is useful for verifying the plugin's functionality and ensuring it integrates correctly with your project. ```bash composer test ``` -------------------------------- ### Configure Filament MailLog Options Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Customizes Filament MailLog settings, including Amazon SES configuration, navigation visibility and sorting, and default table sorting behavior. ```php [ 'configuration-set' => env('SES_CONFIGURATION_SET', null), ], // Custom resource class (override to extend functionality) 'resources' => [ 'MaiLogResource' => MailLogResource::class, ], // Navigation settings in Filament admin panel 'navigation' => [ 'maillog' => [ 'register' => true, // Set to false to hide from navigation 'sort' => 1, // Navigation menu position 'icon' => 'heroicon-o-rectangle-stack', // Navigation icon ], ], // Default table sorting 'sort' => [ 'column' => 'created_at', 'direction' => 'desc', ], ]; ``` -------------------------------- ### Publish Mail Log Configuration File Source: https://github.com/tappnetwork/filament-maillog/blob/2.x/README.md Publishes the configuration file for the Filament Mail Log plugin. This allows customization of settings such as Amazon SES configuration, resource registration, and navigation options. ```bash php artisan vendor:publish --tag="filament-maillog-config" ``` -------------------------------- ### Configure Filament Mail Log Plugin in AdminPanelProvider Source: https://github.com/tappnetwork/filament-maillog/blob/2.x/README.md Integrates the Filament Mail Log plugin into your Filament admin panel by adding it to the `plugins()` method in your `AdminPanelProvider`. This makes the mail log resource accessible within the admin interface. ```php use Tapp\FilamentMailLog\FilamentMailLogPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ FilamentMailLogPlugin::make(), //... ]); } ``` -------------------------------- ### Register Filament MailLog Plugin in Filament Panel Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Registers the FilamentMailLogPlugin within the Filament admin panel configuration to make the Mail Logs resource accessible in the admin interface. ```php default() ->id('admin') ->path('admin') ->login() ->plugins([ FilamentMailLogPlugin::make(), // ... other plugins ]); } } ``` -------------------------------- ### Customize Mail Log Translations (PHP) Source: https://context7.com/tappnetwork/filament-maillog/llms.txt This snippet shows how to publish and customize translation files for the Filament MailLog package. It allows developers to modify the default English labels for various elements within the mail log interface to support different locales. No external dependencies are required beyond the package itself. ```php 'Logs', 'navigation.maillog.label' => 'Mail Log', 'navigation.maillog.plural-label' => 'Mail Logs', 'table.heading' => 'Mail Logs', 'column.status' => 'Status', 'column.subject' => 'Subject', 'column.to' => 'To', 'column.from' => 'From', 'column.cc' => 'CC', 'column.bcc' => 'BCC', 'column.message_id' => 'Message ID', 'column.delivered' => 'Delivered', 'column.opened' => 'Opened', 'column.bounced' => 'Bounced', 'column.complaint' => 'Complaint', 'column.body' => 'Body', 'column.headers' => 'Headers', 'column.attachments' => 'Attachments', 'column.data' => 'Data', 'column.created_at' => 'Created At', 'column.updated_at' => 'Updated At', ]; ``` -------------------------------- ### Database Schema for Mail Logs (PHP) Source: https://context7.com/tappnetwork/filament-maillog/llms.txt Defines the database schema for the 'mail_logs' table using Laravel's schema builder. It includes fields for sender, recipients, subject, body, attachments, message ID, status, and timestamps for various email events. ```php increments('id'); $table->string('from')->nullable(); $table->string('to')->nullable(); $table->string('cc')->nullable(); $table->string('bcc')->nullable(); $table->string('subject'); $table->longText('body'); $table->text('headers')->nullable(); $table->longText('attachments')->nullable(); $table->uuid('message_id')->nullable(); $table->string('status')->nullable(); $table->longText('data')->nullable(); // JSON data from SES $table->timestamp('opened')->nullable(); $table->timestamp('delivered')->nullable(); $table->timestamp('complaint')->nullable(); $table->timestamp('bounced')->nullable(); $table->timestamps(); $table->index('message_id'); $table->index('status'); }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.