Skip to content

Commit

Permalink
Merge pull request #11 from TappNetwork/queue-events
Browse files Browse the repository at this point in the history
Make sure the event handler to log mail is queued
  • Loading branch information
swilla authored Jan 9, 2025
2 parents cd599a3 + 91c6b9f commit 1f0a688
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/Events/MailLogEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
namespace Tapp\FilamentMailLog\Events;

use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Events\MessageSending;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Str;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Part\DataPart;
use Tapp\FilamentMailLog\Models\MailLog;

class MailLogEventHandler
class MailLogEventHandler implements ShouldQueue
{
public function __construct(
) {}
use InteractsWithQueue;

public function __construct()
{
//
}

public function subscribe(Dispatcher $events): void
{
Expand Down
3 changes: 3 additions & 0 deletions src/Models/MailLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
* @property array $data
*/
class MailLog extends Model
{
use HasFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/MailLogResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static function getPages(): array
{
return [
'index' => Pages\ListMailLogs::route('/'),
//'view' => Pages\ViewMailLog::route('/{record}'),
// 'view' => Pages\ViewMailLog::route('/{record}'),
];
}
}

0 comments on commit 1f0a688

Please # to comment.