blue-twilight/app/Mail/TestMailConfig.php

47 lines
1.0 KiB
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;
/**
* NOTE: This does not need converting to a notification. It should always be sent immediately and not queued.
*/
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')]);
2016-09-06 14:19:16 +01:00
return $this
->subject($subject)
->markdown(Theme::viewName('email.test_email'))
2016-09-06 14:19:16 +01:00
->with(['subject' => $subject]);
}
}