Correct way to append locale
This commit is contained in:
@@ -44,7 +44,7 @@ class CreateCheckoutRequestAction
|
||||
$asset->request();
|
||||
$asset->increment('requests_counter', 1);
|
||||
try {
|
||||
$settings->notify(new RequestAssetNotification($data));
|
||||
$settings->notify((new RequestAssetNotification($data))->locale($settings->locale));
|
||||
} catch (\Exception $e) {
|
||||
Log::warning($e);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ class ViewAssetsController extends Controller
|
||||
$logaction->logaction(ActionType::RequestCanceled);
|
||||
|
||||
if (($settings->alert_email != '') && ($settings->alerts_enabled == '1') && (! config('app.lock_passwords'))) {
|
||||
$settings->notify(new RequestAssetCancelation($data));
|
||||
$settings->notify((new RequestAssetNotification($data))->locale($settings->locale));
|
||||
}
|
||||
|
||||
return redirect()->back()->with('success')->with('success', trans('admin/hardware/message.requests.canceled'));
|
||||
@@ -213,7 +213,7 @@ class ViewAssetsController extends Controller
|
||||
$item->request();
|
||||
if (($settings->alert_email != '') && ($settings->alerts_enabled == '1') && (! config('app.lock_passwords'))) {
|
||||
$logaction->logaction('requested');
|
||||
$settings->notify(new RequestAssetNotification($data));
|
||||
$settings->notify((new RequestAssetNotification($data))->locale($settings->locale));
|
||||
}
|
||||
|
||||
return redirect()->route('requestable-assets')->with('success')->with('success', trans('admin/hardware/message.requests.success'));
|
||||
|
||||
@@ -102,8 +102,6 @@ class RequestAssetNotification extends Notification
|
||||
if (($this->item->model) && ($this->item->model->fieldset)) {
|
||||
$fields = $this->item->model->fieldset->fields;
|
||||
}
|
||||
$originalLocale = app()->getLocale();
|
||||
app()->setLocale($this->settings->locale);
|
||||
|
||||
$message = (new MailMessage)->markdown('notifications.markdown.asset-requested',
|
||||
[
|
||||
@@ -123,8 +121,6 @@ class RequestAssetNotification extends Notification
|
||||
'X-System-Sender', 'Snipe-IT'
|
||||
);
|
||||
});
|
||||
|
||||
app()->setLocale($originalLocale);
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user