mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
67 lines
1.5 KiB
PHP
67 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\SubTask;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class SubTaskDeleted extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public $subtask;
|
|
public $creator;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(SubTask $subtask)
|
|
{
|
|
$creator = \App\Models\User::find($subtask->created_by);
|
|
$this->creator = ($creator) ? $creator->firstname . ' ' . $creator->lastname : '';
|
|
|
|
$this->subtask = $subtask;
|
|
}
|
|
|
|
/**
|
|
* Get the message envelope.
|
|
*
|
|
* @return \Illuminate\Mail\Mailables\Envelope
|
|
*/
|
|
public function envelope()
|
|
{
|
|
return new Envelope(
|
|
subject: 'Bol vytvorený Sub Task ' . $this->subtask->mastertask->project->code . ' - ' . ($this->subtask->title) ?: $this->subtask->mastertask->title,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*
|
|
* @return \Illuminate\Mail\Mailables\Content
|
|
*/
|
|
public function content()
|
|
{
|
|
return new Content(
|
|
view: 'emails.task.sub_task_deleted',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the attachments for the message.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function attachments()
|
|
{
|
|
return [];
|
|
}
|
|
}
|