<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class AdminNotification extends Mailable
{
    use Queueable, SerializesModels;

    public $registration;

    /**
     * Create a new message instance.
     */
    public function __construct($registration)
    {
        $this->registration = $registration;
    }

    /**
     * Build the message.
     */
    public function build()
    {
        return $this->subject('New Registration: '.$this->registration->course.' - '.$this->registration->full_name)
                    ->view('emails.admin-notification')
                    ->with([
                        'fullName' => $this->registration->full_name,
                        'email' => $this->registration->email,
                        'phone' => $this->registration->phone,
                        'course' => $this->registration->course,
                        'session' => $this->registration->session,
                        'message' => $this->registration->message,
                    ]);
    }
}