Added mailer

This commit is contained in:
snipe
2026-05-30 12:26:04 +01:00
parent f133a67550
commit ff6fc68981
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Mail;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class BulkDeleteReportMail extends BaseMailable
{
use Queueable, SerializesModels;
public function __construct(
public readonly User $admin,
public readonly bool $dryRun,
public readonly array $companyNames,
public readonly array $selectedTypes,
public readonly string $deleteType,
public readonly array $reportLines,
public readonly Carbon $runAt,
) {}
public function envelope(): Envelope
{
$subject = $this->dryRun
? '[Dry Run] Bulk Check-in/Delete Report'
: 'Bulk Check-in/Delete Report';
return new Envelope(
from: new Address(config('mail.from.address'), config('mail.from.name')),
subject: $subject,
);
}
public function content(): Content
{
return new Content(
markdown: 'notifications.markdown.report-bulk-delete',
with: [
'admin' => $this->admin,
'dryRun' => $this->dryRun,
'companyNames' => $this->companyNames,
'selectedTypes' => $this->selectedTypes,
'deleteType' => $this->deleteType,
'reportLines' => $this->reportLines,
'runAt' => $this->runAt,
],
);
}
public function attachments(): array
{
return [];
}
}