Add manage link to email notifications
This commit is contained in:
committed by
Graham Campbell
parent
af0e578a44
commit
e51504b3ec
@@ -59,6 +59,7 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
foreach (Subscription::isVerifiedForComponent($component->id)->with('subscriber')->get() as $subscription) {
|
||||
$subscriber = $subscription->subscriber;
|
||||
$mail['email'] = $subscriber->email;
|
||||
$mail['manage_link'] = route('subscribe.manage', ['code' => $subscriber->verify_code]);
|
||||
$mail['unsubscribe_link'] = route('subscribe.unsubscribe', ['code' => $subscriber->verify_code, 'subscription' => $subscription->id]);
|
||||
|
||||
$this->mailer->queue([
|
||||
|
||||
@@ -75,6 +75,7 @@ class SendIncidentEmailNotificationHandler
|
||||
'html_content' => $incident->formattedMessage,
|
||||
'text_content' => $incident->message,
|
||||
'token' => $subscriber->token,
|
||||
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]),
|
||||
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
];
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ class SendMaintenanceEmailNotificationHandler
|
||||
'text_content' => $data->message,
|
||||
'scheduled_at' => $data->scheduled_at_formatted,
|
||||
'token' => $subscriber->token,
|
||||
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]),
|
||||
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
];
|
||||
|
||||
|
||||
@@ -131,11 +131,13 @@ class SubscribeController extends Controller
|
||||
/**
|
||||
* Shows the subscription manager page.
|
||||
*
|
||||
* @param string|null $code
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showManage()
|
||||
public function showManage($code = null)
|
||||
{
|
||||
if (!($code = Binput::get('subscriber'))) {
|
||||
if ($code === null) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ class SubscribeRoutes
|
||||
'uses' => 'SubscribeController@postSubscribe',
|
||||
]);
|
||||
|
||||
$router->get('subscribe/manage', [
|
||||
'as' => 'subscribe.manage',
|
||||
$router->get('subscribe/manage/{code}', [
|
||||
'as' => 'manage',
|
||||
'uses' => 'SubscribeController@showManage',
|
||||
]);
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ return [
|
||||
'subscribe' => 'Subscribe to email updates.',
|
||||
'subscribed' => 'You\'ve been subscribed to email notifications, please check your email to confirm your subscription.',
|
||||
'verified' => 'Your email subscription has been confirmed. Thank you!',
|
||||
'manage' => 'Manage your subscription.',
|
||||
'unsubscribe' => 'Unsubscribe from email updates.',
|
||||
'unsubscribed' => 'Your email subscription has been cancelled.',
|
||||
'failure' => 'Something went wrong with the subscription.',
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by', ['app' => $app_name]) !!}</p>
|
||||
@endif
|
||||
<p>
|
||||
<small><a href="{{ $manage_link }}">{!! trans('cachet.subscriber.email.manage') !!}</a></small>
|
||||
</p>
|
||||
<p>
|
||||
<small><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></small>
|
||||
</p>
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
|
||||
@endif
|
||||
|
||||
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
|
||||
|
||||
{!! trans('cachet.subscriber.email.unsubscribe') !!} {{ $unsubscribe_link }}
|
||||
|
||||
@@ -5,22 +5,25 @@
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => $app_name]) !!}
|
||||
{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => $app_name]) !!}
|
||||
|
||||
<p>{{ $scheduled_at }}</p>
|
||||
<p>{{ $scheduled_at }}</p>
|
||||
|
||||
<p>
|
||||
{!! $status !!}
|
||||
</p>
|
||||
<p>
|
||||
{!! $status !!}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{!! $html_content !!}
|
||||
</p>
|
||||
<p>
|
||||
{!! $html_content !!}
|
||||
</p>
|
||||
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by', ['app' => $app_name]) !!}</p>
|
||||
@endif
|
||||
<p>
|
||||
<small><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></small>
|
||||
</p>
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by', ['app' => $app_name]) !!}</p>
|
||||
@endif
|
||||
<p>
|
||||
<small><a href="{{ $manage_link }}">{!! trans('cachet.subscriber.email.manage') !!}</a></small>
|
||||
</p>
|
||||
<p>
|
||||
<small><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></small>
|
||||
</p>
|
||||
@stop
|
||||
|
||||
@@ -10,4 +10,6 @@
|
||||
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
|
||||
@endif
|
||||
|
||||
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
|
||||
|
||||
{!! trans('cachet.subscriber.email.unsubscribe') !!} {{ $unsubscribe_link }}
|
||||
|
||||
@@ -5,23 +5,26 @@
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
{!! trans('cachet.subscriber.email.incident.html-preheader', ['app_name' => $app_name]) !!}
|
||||
{!! trans('cachet.subscriber.email.incident.html-preheader', ['app_name' => $app_name]) !!}
|
||||
|
||||
<p>
|
||||
{!! $status !!}
|
||||
@if($has_component)
|
||||
({{ $component_name }})
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{!! $html_content !!}
|
||||
</p>
|
||||
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by', ['app' => $app_name]) !!}</p>
|
||||
<p>
|
||||
{!! $status !!}
|
||||
@if($has_component)
|
||||
({{ $component_name }})
|
||||
@endif
|
||||
<p>
|
||||
<small><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></small>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{!! $html_content !!}
|
||||
</p>
|
||||
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by', ['app' => $app_name]) !!}</p>
|
||||
@endif
|
||||
<p>
|
||||
<small><a href="{{ $manage_link }}">{!! trans('cachet.subscriber.email.manage') !!}</a></small>
|
||||
</p>
|
||||
<p>
|
||||
<small><a href="{{ $unsubscribe_link }}">{!! trans('cachet.subscriber.email.unsubscribe') !!}</a></small>
|
||||
</p>
|
||||
@stop
|
||||
|
||||
@@ -11,4 +11,6 @@
|
||||
{!! trans('cachet.powered_by', ['app' => $app_name]) !!}
|
||||
@endif
|
||||
|
||||
{!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }}
|
||||
|
||||
{!! trans('cachet.subscriber.email.unsuscribe') !!} {{ $unsubscribe_link }}
|
||||
|
||||
Reference in New Issue
Block a user