mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 07:10:10 +00:00
116f83a367
Co-authored-by: Alex Justesen <alexjustesen@users.noreply.github.com>
36 lines
828 B
PHP
36 lines
828 B
PHP
<?php
|
|
|
|
namespace App\Actions\Notifications;
|
|
|
|
use App\Mail\Test as TestMail;
|
|
use Filament\Notifications\Notification;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
class SendMailTestNotification
|
|
{
|
|
use AsAction;
|
|
|
|
public function handle(array $recipients)
|
|
{
|
|
if (! count($recipients)) {
|
|
Notification::make()
|
|
->title(__('settings/notifications.test_notifications.mail.add'))
|
|
->warning()
|
|
->send();
|
|
|
|
return;
|
|
}
|
|
|
|
foreach ($recipients as $recipient) {
|
|
Mail::to($recipient)
|
|
->send(new TestMail);
|
|
}
|
|
|
|
Notification::make()
|
|
->title(__('settings/notifications.test_notifications.mail.sent'))
|
|
->success()
|
|
->send();
|
|
}
|
|
}
|