mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 05:28:18 +01:00
Updated autopresenter
This commit is contained in:
parent
b6fbe53b28
commit
995fdd4049
@ -15,7 +15,7 @@ use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use McCool\LaravelAutoPresenter\PresenterDecorator;
|
||||
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
|
||||
|
||||
class SendIncidentEmailNotificationHandler
|
||||
{
|
||||
@ -33,27 +33,18 @@ class SendIncidentEmailNotificationHandler
|
||||
*/
|
||||
protected $subscriber;
|
||||
|
||||
/**
|
||||
* The presenter instance.
|
||||
*
|
||||
* @var \McCool\LaravelAutoPresenter\PresenterDecorator
|
||||
*/
|
||||
protected $presenter;
|
||||
|
||||
/**
|
||||
* Create a new send incident email notification handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
* @param \McCool\LaravelAutoPresenter\PresenterDecorator $presenter
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber, PresenterDecorator $presenter)
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->subscriber = $subscriber;
|
||||
$this->presenter = $presenter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,8 +56,8 @@ class SendIncidentEmailNotificationHandler
|
||||
*/
|
||||
public function handle(IncidentWasReportedEvent $event)
|
||||
{
|
||||
$incident = $this->presenter->decorate($event->incident);
|
||||
$component = $this->presenter->decorate($event->incident->component);
|
||||
$incident = AutoPresenter::decorate($event->incident);
|
||||
$component = AutoPresenter::decorate($event->incident->component);
|
||||
|
||||
// Only send emails for public incidents.
|
||||
if ($event->incident->visible === 1) {
|
||||
|
@ -15,7 +15,7 @@ use CachetHQ\Cachet\Events\Incident\MaintenanceWasScheduledEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use McCool\LaravelAutoPresenter\PresenterDecorator;
|
||||
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
|
||||
|
||||
class SendMaintenanceEmailNotificationHandler
|
||||
{
|
||||
@ -33,27 +33,18 @@ class SendMaintenanceEmailNotificationHandler
|
||||
*/
|
||||
protected $subscriber;
|
||||
|
||||
/**
|
||||
* The presenter instance.
|
||||
*
|
||||
* @var \McCool\LaravelAutoPresenter\PresenterDecorator
|
||||
*/
|
||||
protected $presenter;
|
||||
|
||||
/**
|
||||
* Create a new send maintenance email notification handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
* @param \McCool\LaravelAutoPresenter\PresenterDecorator $presenter
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber, PresenterDecorator $presenter)
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->subscriber = $subscriber;
|
||||
$this->presenter = $presenter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +56,7 @@ class SendMaintenanceEmailNotificationHandler
|
||||
*/
|
||||
public function handle(MaintenanceWasScheduledEvent $event)
|
||||
{
|
||||
$data = $this->presenter->decorate($event->incident);
|
||||
$data = AutoPresenter::decorate($event->incident);
|
||||
|
||||
foreach ($this->subscriber->all() as $subscriber) {
|
||||
$mail = [
|
||||
|
@ -33,7 +33,7 @@
|
||||
"graham-campbell/exceptions": "^5.0",
|
||||
"guzzlehttp/guzzle": "^6.1",
|
||||
"jenssegers/date": "^3.0",
|
||||
"mccool/laravel-auto-presenter": "^3.1",
|
||||
"mccool/laravel-auto-presenter": "^4.1",
|
||||
"pragmarx/google2fa": "^0.5",
|
||||
"roumen/feed": "^2.9"
|
||||
},
|
||||
|
@ -159,7 +159,7 @@ return [
|
||||
'GrahamCampbell\Security\SecurityServiceProvider',
|
||||
'GrahamCampbell\Throttle\ThrottleServiceProvider',
|
||||
'Jenssegers\Date\DateServiceProvider',
|
||||
'McCool\LaravelAutoPresenter\LaravelAutoPresenterServiceProvider',
|
||||
'McCool\LaravelAutoPresenter\AutoPresenterServiceProvider',
|
||||
'PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider',
|
||||
'Roumen\Feed\FeedServiceProvider',
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user