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/netwerkbrabant/netwerkbrabant.nl/app/Mail/Courses/SignedUpMail.php
<?php

namespace App\Mail\Courses;

use App\KommaApp\Orders\Models\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class SignedUpMail extends Mailable
{
    use Queueable, SerializesModels;

    private $order;
    private $course;
    private $siteUrl;
//    private $pdfPath;

    /**
     * SignedUpMail constructor.
     * @param Order $order
     */
    public function __construct(Order $order)
    {
        $this->order = $order;
        $course = $this->order->products->first()->productable;
        $this->course = $course->load('translation', 'images');
//        $this->pdfPath = $pdfPath;

        if(config('app.env') !== 'production') $this->siteUrl = 'http://netwerkbrabant.komma.pro';
        else $this->siteUrl = config('site.company.url');
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        Log::info(self::class.': Send');

        return $this->view('site.emails.courses.signedUp')
            ->subject(trans('site/emails.courses.signedUp'))
            ->to($this->order->email)
            ->with([
                'firstName' => $this->order->invoice_first_name,
                'lastName' => $this->order->invoice_last_name,
                'price' => $this->order->price,
                'course' => $this->course,
                'siteUrl' => $this->siteUrl,
            ]);
    }
}