blue-twilight/app/Mail/TestMailConfig.php

44 lines
989 B
PHP
Raw Normal View History

<?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->from($this->senderAddress, $this->senderName)
->subject($subject)
->view(Theme::viewName('email.test_email'))
->with(['subject' => $subject]);
}
}