generated from boboko/starter
36 lines
962 B
PHP
36 lines
962 B
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Address;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
|
|
/**
|
|
* A contact-form message, sent to the store's CONTACT_EMAIL. Reply-To is the
|
|
* sender, so replying from the inbox goes straight to them.
|
|
*/
|
|
class ContactMessageMail extends Mailable
|
|
{
|
|
public function __construct(
|
|
public readonly string $senderName,
|
|
public readonly string $senderEmail,
|
|
public readonly string $body,
|
|
public readonly string $senderLocale,
|
|
) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
replyTo: [new Address($this->senderEmail, $this->senderName)],
|
|
subject: "Νέο μήνυμα επικοινωνίας από {$this->senderName}",
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(view: 'emails.contact-message');
|
|
}
|
|
}
|