2020-07-22 05:03:33 +02:00
|
|
|
<?php
|
2021-06-09 17:00:35 +02:00
|
|
|
|
2020-07-22 05:03:33 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-07-22 05:03:33 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-07-22 05:03:33 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-07-22 05:03:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Mail\User;
|
|
|
|
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
|
|
|
|
class UserNotificationMailer extends Mailable
|
|
|
|
{
|
|
|
|
public $mail_obj;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param $mail_obj
|
2020-07-22 05:03:33 +02:00
|
|
|
*/
|
|
|
|
public function __construct($mail_obj)
|
|
|
|
{
|
|
|
|
$this->mail_obj = $mail_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2020-12-02 04:08:35 +01:00
|
|
|
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
2021-06-09 17:00:35 +02:00
|
|
|
->subject($this->mail_obj->subject)
|
2022-06-21 11:57:17 +02:00
|
|
|
->text('email.admin.generic_text', [
|
2022-03-04 04:01:09 +01:00
|
|
|
'title' => $this->mail_obj->data['title'],
|
|
|
|
'body' => $this->mail_obj->data['message'],
|
|
|
|
])
|
2021-06-09 17:00:35 +02:00
|
|
|
->view($this->mail_obj->markdown, $this->mail_obj->data)
|
2022-06-21 11:59:02 +02:00
|
|
|
->withSymfonyMessage(function ($message) {
|
2021-06-09 17:00:35 +02:00
|
|
|
$message->getHeaders()->addTextHeader('Tag', $this->mail_obj->tag);
|
|
|
|
});
|
2020-07-22 05:03:33 +02:00
|
|
|
}
|
|
|
|
}
|