diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index cc712e271..ba7c3b201 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -111,7 +111,7 @@ class CheckinAccessoryNotification extends Notification ]; return (new SlackMessage) - ->content(':arrow_down: :keyboard: Accessory Checked In') + ->content(':arrow_down: :keyboard: '.trans('mail.Accessory_Checkin_Notification')) ->from($botname) ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) @@ -135,7 +135,7 @@ class CheckinAccessoryNotification extends Notification 'note' => $this->note, 'target' => $this->target, ]) - ->subject('Accessory checked in'); + ->subject(trans('mail.Accessory_Checkin_Notification')); } } diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index 0b0c29d7b..e0f1e66f3 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -79,7 +79,7 @@ class CheckinAssetNotification extends Notification ]; return (new SlackMessage) - ->content(':arrow_down: :computer: Asset Checked In') + ->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification')) ->from($botname) ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) @@ -113,7 +113,7 @@ class CheckinAssetNotification extends Notification 'fields' => $fields, 'expected_checkin' => $this->expected_checkin, ]) - ->subject('Asset checked in'); + ->subject(trans('mail.Asset_Checkin_Notification')); return $message; diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index f9d4914c3..a3bfb039e 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -83,7 +83,7 @@ class CheckinLicenseSeatNotification extends Notification return (new SlackMessage) - ->content(':arrow_down: :floppy_disk: License Checked In') + ->content(':arrow_down: :floppy_disk: '.trans('mail.License_Checkin_Notification')) ->from($botname) ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) @@ -106,7 +106,7 @@ class CheckinLicenseSeatNotification extends Notification 'note' => $this->note, 'target' => $this->target, ]) - ->subject('License checked in'); + ->subject(trans('mail.License_Checkin_Notification')); } diff --git a/app/Notifications/ExpectedCheckinAdminNotification.php b/app/Notifications/ExpectedCheckinAdminNotification.php index c90c2fa3e..7f29a915f 100644 --- a/app/Notifications/ExpectedCheckinAdminNotification.php +++ b/app/Notifications/ExpectedCheckinAdminNotification.php @@ -48,7 +48,7 @@ class ExpectedCheckinAdminNotification extends Notification [ 'assets' => $this->assets, ]) - ->subject('Expected asset checkin report'); + ->subject(trans('mail.Expected_Checkin_Report')); return $message; diff --git a/app/Notifications/ExpectedCheckinNotification.php b/app/Notifications/ExpectedCheckinNotification.php index e7262ae54..dadd920cf 100644 --- a/app/Notifications/ExpectedCheckinNotification.php +++ b/app/Notifications/ExpectedCheckinNotification.php @@ -2,7 +2,7 @@ namespace App\Notifications; -use Carbon\Carbon; +use App\Helpers\Helper; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; @@ -46,16 +46,18 @@ class ExpectedCheckinNotification extends Notification */ public function toMail() { - $formatted_due = Carbon::parse($this->params->expected_checkin)->format('D, M j, Y'); - return (new MailMessage) - ->error() - ->subject('Reminder: '.$this->params->present()->name().' checkin deadline approaching') - ->line('Hi, '.$this->params->assignedto->first_name.' '.$this->params->assignedto->last_name) - ->greeting('An asset checked out to you is due to be checked back in on '.$formatted_due.'.') - ->line('Asset: '.$this->params->present()->name()) - ->line('Serial: '.$this->params->serial) - ->line('Asset Tag: '.$this->params->asset_tag) - ->action('View Your Assets', route('view-assets')); + + $message = (new MailMessage)->markdown('notifications.markdown.expected-checkin', + [ + 'date' => Helper::getFormattedDateObject($this->params->expected_checkin, 'date', false), + 'asset' => $this->params->present()->name(), + 'serial' => $this->params->serial, + 'asset_tag' => $this->params->asset_tag + ]) + ->subject(trans('mail.Expected_Checkin_Notification', ['name' => $this->params->present()->name()])); + + return $message; + } } diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index 8b60aa7d7..e756ef79f 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -242,4 +242,9 @@ 'login_enabled' => 'Login Enabled', 'audit_due' => 'Due for Audit', 'audit_overdue' => 'Overdue for Audit', + 'accept' => 'Accept :asset', + 'i_accept' => 'I accept', + 'i_decline' => 'I decline', + 'sign_tos' => 'Sign below to indicate that you agree to the terms of service:', + 'clear_signature' => 'Clear Signature' ]; diff --git a/resources/lang/en/mail.php b/resources/lang/en/mail.php index f8c781c8e..23cc8e58b 100644 --- a/resources/lang/en/mail.php +++ b/resources/lang/en/mail.php @@ -70,5 +70,11 @@ return array( 'welcome' => 'Welcome :name', 'welcome_to' => 'Welcome to :web!', 'your_credentials' => 'Your Snipe-IT credentials', - + 'Accessory_Checkin_Notification' => 'Accessory checked in', + 'Asset_Checkin_Notification' => 'Asset checked in', + 'License_Checkin_Notification' => 'License checked in', + 'Expected_Checkin_Report' => 'Expected asset checkin report' + 'Expected_Checkin_Notification' => 'Reminder: :name checkin deadline approaching', + 'Expected_Checkin_Date' => 'An asset checked out to you is due to be checked back in on :date', + 'your_assets' => 'View Your Assets' ); diff --git a/resources/views/account/accept-asset.blade.php b/resources/views/account/accept-asset.blade.php index 780b9408e..ca27f1880 100644 --- a/resources/views/account/accept-asset.blade.php +++ b/resources/views/account/accept-asset.blade.php @@ -2,7 +2,7 @@ {{-- Page title --}} @section('title') - Accept {{ $item->present()->name() }} + {{trans('general.accept', ['asset' => $item->present()->name()])}} @parent @stop @@ -42,14 +42,14 @@
@@ -64,7 +64,7 @@ @if ($snipeSettings->require_accept_signature=='1')
-

Sign below to indicate that you agree to the terms of service:

+

{{trans('general.sign_tos')}}

@@ -72,7 +72,7 @@
- +
diff --git a/resources/views/notifications/markdown/asset-requested.blade.php b/resources/views/notifications/markdown/asset-requested.blade.php index 0fe0c6298..1bf8eeaee 100644 --- a/resources/views/notifications/markdown/asset-requested.blade.php +++ b/resources/views/notifications/markdown/asset-requested.blade.php @@ -55,7 +55,7 @@ @endif @endcomponent -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkin-accessory.blade.php b/resources/views/notifications/markdown/checkin-accessory.blade.php index b4f7163d6..cf1536518 100644 --- a/resources/views/notifications/markdown/checkin-accessory.blade.php +++ b/resources/views/notifications/markdown/checkin-accessory.blade.php @@ -25,7 +25,7 @@ @endif @endcomponent -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkin-asset.blade.php b/resources/views/notifications/markdown/checkin-asset.blade.php index 3d313f51d..01ab12f32 100644 --- a/resources/views/notifications/markdown/checkin-asset.blade.php +++ b/resources/views/notifications/markdown/checkin-asset.blade.php @@ -42,7 +42,7 @@ @endif @endcomponent -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkin-license.blade.php b/resources/views/notifications/markdown/checkin-license.blade.php index 6a40cd453..0f14c4bfd 100644 --- a/resources/views/notifications/markdown/checkin-license.blade.php +++ b/resources/views/notifications/markdown/checkin-license.blade.php @@ -24,7 +24,7 @@ @endif @endcomponent -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkout-accessory.blade.php b/resources/views/notifications/markdown/checkout-accessory.blade.php index 421489914..a3126f7aa 100644 --- a/resources/views/notifications/markdown/checkout-accessory.blade.php +++ b/resources/views/notifications/markdown/checkout-accessory.blade.php @@ -47,7 +47,7 @@ @endif -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkout-asset.blade.php b/resources/views/notifications/markdown/checkout-asset.blade.php index ba8939007..8e6297897 100644 --- a/resources/views/notifications/markdown/checkout-asset.blade.php +++ b/resources/views/notifications/markdown/checkout-asset.blade.php @@ -64,7 +64,7 @@ @endif -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkout-consumable.blade.php b/resources/views/notifications/markdown/checkout-consumable.blade.php index b4362d69b..06e73243c 100644 --- a/resources/views/notifications/markdown/checkout-consumable.blade.php +++ b/resources/views/notifications/markdown/checkout-consumable.blade.php @@ -44,7 +44,7 @@ @endif -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/checkout-license.blade.php b/resources/views/notifications/markdown/checkout-license.blade.php index f83875112..08e1e5c76 100644 --- a/resources/views/notifications/markdown/checkout-license.blade.php +++ b/resources/views/notifications/markdown/checkout-license.blade.php @@ -47,7 +47,7 @@ @endif -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }} diff --git a/resources/views/notifications/markdown/expected-checkin.blade.php b/resources/views/notifications/markdown/expected-checkin.blade.php new file mode 100644 index 000000000..182f88ec1 --- /dev/null +++ b/resources/views/notifications/markdown/expected-checkin.blade.php @@ -0,0 +1,20 @@ +@component('mail::message') +# {{ trans('mail.hello') }}, + +{{ trans('mail.Expected_Checkin_Date', ['date' => $date]) }} + +@if ((isset($asset)) && ($asset!='')) +{{ trans('mail.asset_name') }} {{ $asset }} +@endif +{{ trans('mail.asset_tag') }} {{ $asset_tag }} +@if (isset($serial)) +{{ trans('mail.serial') }}: {{ $serial }} +@endif + +**[{{ trans('mail.your_assets') }}]({{ route('view-assets') }})** + +{{ trans('mail.best_regards') }} + +{{ $snipeSettings->site_name }} + +@endcomponent diff --git a/resources/views/notifications/markdown/report-expected-checkins.blade.php b/resources/views/notifications/markdown/report-expected-checkins.blade.php index 907c82607..f27555f97 100644 --- a/resources/views/notifications/markdown/report-expected-checkins.blade.php +++ b/resources/views/notifications/markdown/report-expected-checkins.blade.php @@ -14,7 +14,7 @@ $checkin = \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, @endforeach @endcomponent -Thanks, +{{ trans('mail.best_regards') }} {{ $snipeSettings->site_name }}