Certificate manager built on Laravel 13, Livewire 4, and Flux. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Attachment;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class SharedCertificatesMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
/**
|
|
* @param string $zipPath Absolute path to the password-protected archive.
|
|
*/
|
|
public function __construct(
|
|
public string $senderName,
|
|
public string $zipPath,
|
|
) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: __(':name shared certificates with you', ['name' => $this->senderName]),
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'mail.shared-certificates',
|
|
with: ['senderName' => $this->senderName],
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @return array<int, Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [
|
|
Attachment::fromPath($this->zipPath)
|
|
->as('certificates.zip')
|
|
->withMime('application/zip'),
|
|
];
|
|
}
|
|
}
|