2026-03-11 23:33:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
use App\Models\Declaration;
|
|
|
|
|
use App\Models\DeclarationInvitation;
|
2026-03-11 23:33:10 +00:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
|
use Illuminate\Mail\Mailables\Content;
|
|
|
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
class DeclarationInviteMail extends Mailable
|
2026-03-11 23:33:10 +00:00
|
|
|
{
|
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new message instance.
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
2026-03-12 18:25:32 +00:00
|
|
|
public Declaration $declaration,
|
|
|
|
|
public DeclarationInvitation $invitation
|
2026-03-11 23:33:10 +00:00
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the message envelope.
|
|
|
|
|
*/
|
|
|
|
|
public function envelope(): Envelope
|
|
|
|
|
{
|
|
|
|
|
return new Envelope(
|
2026-03-12 18:25:32 +00:00
|
|
|
subject: 'Dépôt de documents - '.$this->declaration->title,
|
2026-03-11 23:33:10 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the message content definition.
|
|
|
|
|
*/
|
|
|
|
|
public function content(): Content
|
|
|
|
|
{
|
|
|
|
|
return new Content(
|
2026-03-12 18:25:32 +00:00
|
|
|
markdown: 'emails.declaration-invite',
|
2026-03-11 23:33:10 +00:00
|
|
|
with: [
|
2026-03-12 18:25:32 +00:00
|
|
|
'declarationTitle' => $this->declaration->title,
|
2026-03-11 23:33:10 +00:00
|
|
|
'uploadUrl' => route('client.upload', ['token' => $this->invitation->token]),
|
|
|
|
|
'expiresAt' => $this->invitation->expires_at->format('d/m/Y à H:i'),
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|