Show the scheduled time if applicable. Closes #799

This commit is contained in:
James Brooks
2015-08-13 23:23:18 +01:00
parent 1965dbb3e7
commit b68647df8e
5 changed files with 17 additions and 1 deletions

View File

@@ -70,6 +70,7 @@ class SendMaintenanceEmailNotificationHandler
'status' => $data->humanStatus,
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'scheduled_at' => $data->scheduled_at_formatted,
'token' => $subscriber->token,
'unsubscribeLink' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
'appUrl' => env('APP_URL'),

View File

@@ -160,7 +160,7 @@ class IncidentPresenter extends AbstractPresenter
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'scheduled_at' => $this->created_at(),
'scheduled_at' => $this->scheduled_at(),
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
]);

View File

@@ -26,6 +26,17 @@ trait TimestampsTrait
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
}
/**
* Present formatted date time.
*
* @return string
*/
public function scheduled_at()
{
return (new Date($this->wrappedObject->scheduled_at))
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
}
/**
* Present formatted date time.
*

View File

@@ -7,6 +7,8 @@
@section('content')
{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => Setting::get('app_name')]) !!}
<p>{{ $scheduled_at }}</p>
<p>
{!! $status !!}
</p>

View File

@@ -1,5 +1,7 @@
{!! trans('cachet.subscriber.email.maintenance.text', ['app_name' => Setting::get('app_name')]) !!}
{{ $scheduled_at }}
{!! $status !!}
{!! $textContent !!}