<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class EmailRegistration extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @param $body
     * @param $head
     * @param $subject
     * @param $from
     */
    public function __construct($body, $head, $subject, $from)
    {
        $this->body = $body;
        $this->head = $head;
        $this->subject = $subject;
        $this->from = $from;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return MailMessage
     */
    public function toMail($notifiable)
    {

        return (new MailMessage)->markdown('email_approved',
            [
                'body'=>$this->body,
                'head'=>$this->head
            ])  ->subject($this->subject)
            ->from($this->from);
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}
