82 lines
1.9 KiB
PHP
82 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Address;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ContactMessageReceived extends Mailable
|
|
{
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @param string $first_name
|
|
* @param string $last_name
|
|
* @param string $email
|
|
* @param string $message
|
|
* @return void
|
|
*/
|
|
public function __construct(
|
|
private string $first_name,
|
|
private string $last_name,
|
|
private string $email,
|
|
private string $message,
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Get the message envelope.
|
|
*
|
|
* @return \Illuminate\Mail\Mailables\Envelope
|
|
*/
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: \trans('Kontaktformular :appname', [
|
|
'appname' => \config('app.name')
|
|
]),
|
|
from: new Address(
|
|
'no-reply@nature-and-respect.com',
|
|
'Kontaktformular'
|
|
),
|
|
to: [
|
|
'contact@nature-and-respect.com',
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*
|
|
* @return \Illuminate\Mail\Mailables\Content
|
|
*/
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'emails.contact-message-received',
|
|
with: [
|
|
'first_name' => $this->first_name,
|
|
'last_name' => $this->last_name,
|
|
'email' => $this->email,
|
|
'message' => $this->message,
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the attachments for the message.
|
|
*
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|