40 lines
833 B
PHP
40 lines
833 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class WebmailMessageMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
/**
|
|
* @param array<string, string> $payload
|
|
*/
|
|
public function __construct(public array $payload)
|
|
{
|
|
}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: $this->payload['subject'] ?? 'Nouveau message',
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'emails.webmail_message',
|
|
with: [
|
|
'body' => $this->payload['body'] ?? '',
|
|
],
|
|
);
|
|
}
|
|
} |