mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
This commit is contained in:
commit
41a9e5f710
|
@ -10,6 +10,7 @@ use App\Models\Setting;
|
||||||
use Mail;
|
use Mail;
|
||||||
use App\Notifications\SlackTest;
|
use App\Notifications\SlackTest;
|
||||||
use Notification;
|
use Notification;
|
||||||
|
use App\Notifications\MailTest;
|
||||||
|
|
||||||
class SettingsController extends Controller
|
class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -132,11 +133,13 @@ class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
if (!config('app.lock_passwords')) {
|
if (!config('app.lock_passwords')) {
|
||||||
try {
|
try {
|
||||||
Mail::send('emails.test', [], function ($m) {
|
Notification::send(Setting::first(), new MailTest());
|
||||||
|
|
||||||
|
/*Mail::send('emails.test', [], function ($m) {
|
||||||
$m->to(config('mail.reply_to.address'), config('mail.reply_to.name'));
|
$m->to(config('mail.reply_to.address'), config('mail.reply_to.name'));
|
||||||
$m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name'));
|
$m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name'));
|
||||||
$m->subject(trans('mail.test_email'));
|
$m->subject(trans('mail.test_email'));
|
||||||
});
|
});*/
|
||||||
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
|
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return response()->json(['message' => $e->getMessage()], 500);
|
return response()->json(['message' => $e->getMessage()], 500);
|
||||||
|
|
|
@ -180,6 +180,13 @@ class Setting extends Model
|
||||||
return $this->slack_endpoint;
|
return $this->slack_endpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function routeNotificationForMail()
|
||||||
|
{
|
||||||
|
// At this point the endpoint is the same for everything.
|
||||||
|
// In the future this may want to be adapted for individual notifications.
|
||||||
|
return config('mail.reply_to.address');
|
||||||
|
}
|
||||||
|
|
||||||
public static function passwordComplexityRulesSaving($action = 'update')
|
public static function passwordComplexityRulesSaving($action = 'update')
|
||||||
{
|
{
|
||||||
$security_rules = '';
|
$security_rules = '';
|
||||||
|
|
61
app/Notifications/MailTest.php
Normal file
61
app/Notifications/MailTest.php
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Notifications;
|
||||||
|
|
||||||
|
use App\Models\Settings;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Notifications\Notification;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
|
||||||
|
class MailTest extends Notification
|
||||||
|
{
|
||||||
|
use Queueable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new notification instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the notification's delivery channels.
|
||||||
|
*
|
||||||
|
* @param mixed $notifiable
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function via($notifiable)
|
||||||
|
{
|
||||||
|
return ['mail'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the mail representation of the notification.
|
||||||
|
*
|
||||||
|
* @param mixed $notifiable
|
||||||
|
* @return \Illuminate\Notifications\Messages\MailMessage
|
||||||
|
*/
|
||||||
|
public function toMail($notifiable)
|
||||||
|
{
|
||||||
|
return (new MailMessage)
|
||||||
|
->subject(trans('mail.test_email'))
|
||||||
|
->markdown('notifications.Test');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the array representation of the notification.
|
||||||
|
*
|
||||||
|
* @param mixed $notifiable
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray($notifiable)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -541,7 +541,13 @@
|
||||||
@foreach ($asset->licenseseats as $seat)
|
@foreach ($asset->licenseseats as $seat)
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ route('licenses.show', $seat->license->id) }}">{{ $seat->license->name }}</a></td>
|
<td><a href="{{ route('licenses.show', $seat->license->id) }}">{{ $seat->license->name }}</a></td>
|
||||||
<td>{{ $seat->license->serial }}</td>
|
<td>
|
||||||
|
@can('viewKeys', $seat->license)
|
||||||
|
{!! nl2br(e($seat->license->serial)) !!}
|
||||||
|
@else
|
||||||
|
------------
|
||||||
|
@endcan
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ route('licenses.checkin', $seat->id) }}" class="btn btn-sm bg-purple" data-tooltip="true">{{ trans('general.checkin') }}</a>
|
<a href="{{ route('licenses.checkin', $seat->id) }}" class="btn btn-sm bg-purple" data-tooltip="true">{{ trans('general.checkin') }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
7
resources/views/notifications/Test.blade.php
Normal file
7
resources/views/notifications/Test.blade.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
@component('mail::message')
|
||||||
|
|
||||||
|
{{ trans('mail.test_mail_text') }}
|
||||||
|
|
||||||
|
Thanks,<br>
|
||||||
|
{{ $snipeSettings->site_name }}
|
||||||
|
@endcomponent
|
|
@ -21,6 +21,10 @@
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.logo {
|
||||||
|
width:50px;
|
||||||
|
height:50px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0">
|
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0">
|
||||||
|
|
|
@ -2,7 +2,23 @@
|
||||||
{{-- Header --}}
|
{{-- Header --}}
|
||||||
@slot('header')
|
@slot('header')
|
||||||
@component('mail::header', ['url' => config('app.url')])
|
@component('mail::header', ['url' => config('app.url')])
|
||||||
{{ config('app.name') }}
|
@if($snipeSettings::setupCompleted())
|
||||||
|
@if ($snipeSettings->brand == '3')
|
||||||
|
@if ($snipeSettings->logo!='')
|
||||||
|
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
|
||||||
|
@endif
|
||||||
|
{{ $snipeSettings->site_name }}
|
||||||
|
|
||||||
|
@elseif ($snipeSettings->brand == '2')
|
||||||
|
@if ($snipeSettings->logo!='')
|
||||||
|
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
{{ $snipeSettings->site_name }}
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
Snipe-it
|
||||||
|
@endif
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endslot
|
@endslot
|
||||||
|
|
||||||
|
@ -21,7 +37,11 @@
|
||||||
{{-- Footer --}}
|
{{-- Footer --}}
|
||||||
@slot('footer')
|
@slot('footer')
|
||||||
@component('mail::footer')
|
@component('mail::footer')
|
||||||
© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
|
@if($snipeSettings::setupCompleted())
|
||||||
|
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
|
||||||
|
@else
|
||||||
|
© {{ date('Y') }} Snipe-it. All rights reserved.
|
||||||
|
@endif
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endslot
|
@endslot
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
|
@ -2,7 +2,23 @@
|
||||||
{{-- Header --}}
|
{{-- Header --}}
|
||||||
@slot('header')
|
@slot('header')
|
||||||
@component('mail::header', ['url' => config('app.url')])
|
@component('mail::header', ['url' => config('app.url')])
|
||||||
{{ config('app.name') }}
|
@if($snipeSettings::setupCompleted())
|
||||||
|
@if ($snipeSettings->brand == '3')
|
||||||
|
@if ($snipeSettings->logo!='')
|
||||||
|
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
|
||||||
|
@endif
|
||||||
|
{{ $snipeSettings->site_name }}
|
||||||
|
|
||||||
|
@elseif ($snipeSettings->brand == '2')
|
||||||
|
@if ($snipeSettings->logo!='')
|
||||||
|
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
{{ $snipeSettings->site_name }}
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
Snipe-it
|
||||||
|
@endif
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endslot
|
@endslot
|
||||||
|
|
||||||
|
@ -21,7 +37,11 @@
|
||||||
{{-- Footer --}}
|
{{-- Footer --}}
|
||||||
@slot('footer')
|
@slot('footer')
|
||||||
@component('mail::footer')
|
@component('mail::footer')
|
||||||
© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
|
@if($snipeSettings::setupCompleted())
|
||||||
|
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
|
||||||
|
@else
|
||||||
|
© {{ date('Y') }} Snipe-it. All rights reserved.
|
||||||
|
@endif
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endslot
|
@endslot
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
Loading…
Reference in a new issue