feat(notification): add PDF attachments to ticket availability emails

This commit is contained in:
2026-08-26 08:54:15 -03:00
parent bf02d37a33
commit 8220fb5aaf
5 changed files with 52 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ use App\Domains\Notification\Events\PasswordResetRequested;
use App\Domains\Purchase\Models\Purchase;
use App\Domains\Tenant\Models\Tenant;
use App\Domains\Ticket\Models\Ticket;
use App\Domains\Ticket\Services\TicketPdfService;
use App\Domains\Ticket\Services\TicketPresentationResolver;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
@@ -17,6 +18,7 @@ class NotificationMailService
{
public function __construct(
private readonly MailService $mailService,
private readonly TicketPdfService $ticketPdfService,
) {}
public function sendWelcome(int $userId, string $tenantCode): void
@@ -130,6 +132,11 @@ class NotificationMailService
$this->recipientFor($purchase),
'Tus tickets ya están disponibles',
view('mail.notifications.tickets-available', compact('purchase', 'tickets'))->render(),
attachments: [[
'data' => $this->ticketPdfService->contents($purchase->tenant, $tickets),
'name' => $this->ticketPdfService->filename($tickets),
'mime' => 'application/pdf',
]],
);
}