2016-09-06 12:23:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
2016-09-06 13:26:02 +01:00
|
|
|
use App\Facade\Theme;
|
|
|
|
use App\Facade\UserConfig;
|
2016-09-06 12:23:14 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
class TestMailConfig extends Mailable
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
2016-09-06 13:26:02 +01:00
|
|
|
private $senderAddress;
|
|
|
|
private $senderName;
|
|
|
|
|
2016-09-06 12:23:14 +01:00
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2016-09-06 13:26:02 +01:00
|
|
|
public function __construct($senderName, $senderAddress)
|
2016-09-06 12:23:14 +01:00
|
|
|
{
|
2016-09-06 13:26:02 +01:00
|
|
|
$this->senderName = $senderName;
|
|
|
|
$this->senderAddress = $senderAddress;
|
2016-09-06 12:23:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2016-09-06 13:26:02 +01:00
|
|
|
$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]);
|
2016-09-06 12:23:14 +01:00
|
|
|
}
|
|
|
|
}
|