mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Language of mail doesn't show as intended by the settings. [ch87] (#6619)
* Fixes #5554. Language of mail doesn't show as intended by the settings.
This commit is contained in:
parent
66f557d436
commit
3fa5976315
|
@ -40,11 +40,18 @@ class CheckoutableListener
|
||||||
*/
|
*/
|
||||||
$acceptance = $this->getCheckoutAcceptance($event);
|
$acceptance = $this->getCheckoutAcceptance($event);
|
||||||
|
|
||||||
|
if(!$event->checkedOutTo->locale){
|
||||||
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
|
$this->getNotifiables($event),
|
||||||
|
$this->getCheckoutNotification($event, $acceptance)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
Notification::send(
|
Notification::send(
|
||||||
$this->getNotifiables($event),
|
$this->getNotifiables($event),
|
||||||
$this->getCheckoutNotification($event, $acceptance)
|
$this->getCheckoutNotification($event, $acceptance)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the user about the checked in checkoutable
|
* Notify the user about the checked in checkoutable
|
||||||
|
@ -60,11 +67,18 @@ class CheckoutableListener
|
||||||
/**
|
/**
|
||||||
* Send the appropriate notification
|
* Send the appropriate notification
|
||||||
*/
|
*/
|
||||||
|
if(!$event->checkedOutTo->locale){
|
||||||
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
|
$this->getNotifiables($event),
|
||||||
|
$this->getCheckinNotification($event)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
Notification::send(
|
Notification::send(
|
||||||
$this->getNotifiables($event),
|
$this->getNotifiables($event),
|
||||||
$this->getCheckinNotification($event)
|
$this->getCheckinNotification($event)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a checkout acceptance
|
* Generates a checkout acceptance
|
||||||
|
|
|
@ -15,11 +15,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use App\Http\Traits\UniqueUndeletedTrait;
|
use App\Http\Traits\UniqueUndeletedTrait;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Laravel\Passport\HasApiTokens;
|
use Laravel\Passport\HasApiTokens;
|
||||||
|
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||||
use DB;
|
use DB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class User extends SnipeModel implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
|
class User extends SnipeModel implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, HasLocalePreference
|
||||||
{
|
{
|
||||||
protected $presenter = 'App\Presenters\UserPresenter';
|
protected $presenter = 'App\Presenters\UserPresenter';
|
||||||
use SoftDeletes, ValidatingTrait;
|
use SoftDeletes, ValidatingTrait;
|
||||||
|
@ -643,4 +644,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||||
{
|
{
|
||||||
return $query->leftJoin('departments as departments_users', 'users.department_id', '=', 'departments_users.id')->orderBy('departments_users.name', $order);
|
return $query->leftJoin('departments as departments_users', 'users.department_id', '=', 'departments_users.id')->orderBy('departments_users.name', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preferredLocale(){
|
||||||
|
return $this->locale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,6 @@ class CheckinLicenseSeatNotification extends Notification
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (new MailMessage)->markdown('notifications.markdown.checkin-license',
|
return (new MailMessage)->markdown('notifications.markdown.checkin-license',
|
||||||
[
|
[
|
||||||
'item' => $this->item,
|
'item' => $this->item,
|
||||||
|
|
Loading…
Reference in a new issue