HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/kommabasic.nl/app/Mail/EventSignUpResponseMail.php
<?php

namespace App\Mail;

use App\Events\Models\Event;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class EventSignUpResponseMail extends Mailable
{
    use Queueable, SerializesModels;

    protected $request;
    protected Event $event;

    /**
     * Create a new message instance.
     *
     * EventMail constructor.
     * @param $request
     * @param  Event  $event
     */
    public function __construct($request, Event $event)
    {
        $this->request = $request;
        $this->event = $event;

        // Textarea should be converted with nl2br
        if(isset($this->request['formMessage'])) $this->request['formMessage'] = nl2br($this->request['formMessage']);

    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $subject = __('email.eventSignUp.subject.response') . ' ' . $this->event->translation->name;

        return $this->view('emails.eventSignUpResponse')
            ->subject($subject)
            ->to($this->request['email'])
            ->with([
                'request' => $this->request,
                'event' => $this->event,
                'subject' => $subject,
            ]);
    }
}