mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-24 19:33:07 +01:00
49 lines
943 B
PHP
49 lines
943 B
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
class Alert extends Mailable
|
|
{
|
|
/**
|
|
* Alert text.
|
|
*/
|
|
public $text;
|
|
|
|
/**
|
|
* Alert text.
|
|
*/
|
|
public $title;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*/
|
|
public function __construct($text, $title = '')
|
|
{
|
|
$this->text = $text;
|
|
$this->title = $title;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
$subject = '['.\Config::get('app.name').'] ';
|
|
if (!empty($this->title)) {
|
|
$subject .= $this->title;
|
|
} else {
|
|
// System emails are not translated
|
|
$subject .= 'Alert';
|
|
}
|
|
$subject .= ' - '.\Helper::getDomain();
|
|
$message = $this->subject($subject)
|
|
->view('emails/user/alert', ['text' => $this->text, 'title' => $this->title]);
|
|
|
|
return $message;
|
|
}
|
|
}
|