parent
ff8d6aade6
commit
4af0482a93
@ -8,6 +8,7 @@ use Illuminate\Bus\Queueable;
|
|||||||
use Illuminate\Notifications\Messages\MailMessage;
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
use Illuminate\Notifications\Notification;
|
use Illuminate\Notifications\Notification;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use Toby\Domain\States\VacationRequest\WaitingForTechnical;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
|
|
||||||
@ -43,8 +44,6 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
|||||||
protected function buildMailMessage(string $url): MailMessage
|
protected function buildMailMessage(string $url): MailMessage
|
||||||
{
|
{
|
||||||
$user = $this->user->first_name;
|
$user = $this->user->first_name;
|
||||||
$requester = $this->vacationRequest->user->fullName;
|
|
||||||
$title = $this->vacationRequest->name;
|
|
||||||
$type = $this->vacationRequest->type->label();
|
$type = $this->vacationRequest->type->label();
|
||||||
$from = $this->vacationRequest->from->toDisplayString();
|
$from = $this->vacationRequest->from->toDisplayString();
|
||||||
$to = $this->vacationRequest->to->toDisplayString();
|
$to = $this->vacationRequest->to->toDisplayString();
|
||||||
@ -54,13 +53,8 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
|||||||
->greeting(__("Hi :user!", [
|
->greeting(__("Hi :user!", [
|
||||||
"user" => $user,
|
"user" => $user,
|
||||||
]))
|
]))
|
||||||
->subject(__("Vacation request :title is waiting for your approval", [
|
->subject($this->buildSubject())
|
||||||
"title" => $title,
|
->line($this->buildDescription())
|
||||||
]))
|
|
||||||
->line(__("The vacation request :title from user: :requester is waiting for your approval.", [
|
|
||||||
"title" => $title,
|
|
||||||
"requester" => $requester,
|
|
||||||
]))
|
|
||||||
->line(__("Vacation type: :type", [
|
->line(__("Vacation type: :type", [
|
||||||
"type" => $type,
|
"type" => $type,
|
||||||
]))
|
]))
|
||||||
@ -71,4 +65,38 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
|||||||
]))
|
]))
|
||||||
->action(__("Click here for details"), $url);
|
->action(__("Click here for details"), $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function buildSubject(): string
|
||||||
|
{
|
||||||
|
$title = $this->vacationRequest->name;
|
||||||
|
|
||||||
|
if ($this->vacationRequest->state->equals(WaitingForTechnical::class)) {
|
||||||
|
return __("Vacation request :title is waiting for your technical approval", [
|
||||||
|
"title" => $title,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return __("Vacation request :title is waiting for your administrative approval", [
|
||||||
|
"title" => $title,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function buildDescription(): string
|
||||||
|
{
|
||||||
|
$title = $this->vacationRequest->name;
|
||||||
|
$requester = $this->vacationRequest->user->fullName;
|
||||||
|
|
||||||
|
if ($this->vacationRequest->state->equals(WaitingForTechnical::class)) {
|
||||||
|
return __("The vacation request :title from user :requester is waiting for your technical approval.", [
|
||||||
|
"title" => $title,
|
||||||
|
"requester" => $requester,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return __("The vacation request :title from user :requester is waiting for your administrative approval.", [
|
||||||
|
"title" => $title,
|
||||||
|
"requester" => $requester,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ use Toby\Eloquent\Helpers\ColorGenerator;
|
|||||||
* @property string $first_name
|
* @property string $first_name
|
||||||
* @property string $last_name
|
* @property string $last_name
|
||||||
* @property string $email
|
* @property string $email
|
||||||
|
* @property string $password
|
||||||
* @property string $avatar
|
* @property string $avatar
|
||||||
* @property string $position
|
* @property string $position
|
||||||
* @property Role $role
|
* @property Role $role
|
||||||
|
@ -59,8 +59,10 @@
|
|||||||
"Vacation type: :type": "Rodzaj wniosku: :type",
|
"Vacation type: :type": "Rodzaj wniosku: :type",
|
||||||
"From :from to :to (number of days: :days)": "Od :from do :to (liczba dni: :days)",
|
"From :from to :to (number of days: :days)": "Od :from do :to (liczba dni: :days)",
|
||||||
"Click here for details": "Kliknij, aby zobaczyć szczegóły",
|
"Click here for details": "Kliknij, aby zobaczyć szczegóły",
|
||||||
"Vacation request :title is waiting for your approval": "Wniosek urlopowy :title czeka na zaakceptowanie",
|
"Vacation request :title is waiting for your technical approval": "Wniosek urlopowy :title czeka na akceptacje techniczną",
|
||||||
"The vacation request :title from user: :requester is waiting for your approval.": "Wniosek urlopowy :title od użytkownika :requester czeka na Twoją akceptację.",
|
"Vacation request :title is waiting for your administrative approval": "Wniosek urlopowy :title czeka na akceptacje administracyjną",
|
||||||
|
"The vacation request :title from user :requester is waiting for your technical approval.": "Wniosek urlopowy :title od użytkownika :requester czeka na Twoją akceptację techniczną.",
|
||||||
|
"The vacation request :title from user :requester is waiting for your administrative approval.": "Wniosek urlopowy :title od użytkownika :requester czeka na Twoją akceptację administracyjną.",
|
||||||
"Vacation request :title has been :status": "Wniosek urlopowy :title został :status",
|
"Vacation request :title has been :status": "Wniosek urlopowy :title został :status",
|
||||||
"The vacation request :title for user :requester has been :status.": "Wniosek urlopowy :title od użytkownika :requester został :status.",
|
"The vacation request :title for user :requester has been :status.": "Wniosek urlopowy :title od użytkownika :requester został :status.",
|
||||||
"Vacation request :title has been created on your behalf": "Wniosek urlopowy :title został utworzony w Twoim imieniu",
|
"Vacation request :title has been created on your behalf": "Wniosek urlopowy :title został utworzony w Twoim imieniu",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user