<?php

namespace App\Mail;

use App\Facade\Theme;
use App\Facade\UserConfig;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class TestMailConfig extends Mailable
{
    use Queueable, SerializesModels;

    private $senderAddress;
    private $senderName;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($senderName, $senderAddress)
    {
        $this->senderName = $senderName;
        $this->senderAddress = $senderAddress;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $subject = trans('email.test_email_subject', ['app_name' => UserConfig::get('app_name')]);

        return $this
            ->subject($subject)
            ->markdown(Theme::viewName('email.test_email'))
            ->with(['subject' => $subject]);
    }
}