Fix unsubscribe link. Closes #697

This commit is contained in:
James Brooks
2015-06-10 14:49:55 +01:00
parent afa8c98fbd
commit 8cdfd90df5
4 changed files with 16 additions and 14 deletions

View File

@@ -69,12 +69,13 @@ class SendIncidentEmailNotificationHandler
foreach ($this->subscriber->all() as $subscriber) {
$mail = [
'email' => $subscriber->email,
'subject' => 'New incident reported.',
'status' => $data->humanStatus,
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'email' => $subscriber->email,
'subject' => 'New incident reported.',
'status' => $data->humanStatus,
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'unsubscribeLink' => route('unsubscribe', $subscriber->token),
];
$this->mailer->queue([

View File

@@ -69,12 +69,13 @@ class SendMaintenanceEmailNotificationHandler
foreach ($this->subscriber->all() as $subscriber) {
$mail = [
'email' => $subscriber->email,
'subject' => 'Scheduled maintenance.',
'status' => $data->humanStatus,
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'email' => $subscriber->email,
'subject' => 'Scheduled maintenance.',
'status' => $data->humanStatus,
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'unsubscribeLink' => route('unsubscribe', $subscriber->token),
];
$this->mailer->queue([

View File

@@ -19,6 +19,6 @@
<p>{!! trans('cachet.powered_by', ['app' => Setting::get('app_name')]) !!}</p>
@endif
<p>
<small><a href="{{ route('unsubscribe', $token) }}">{!! trans('cachet.subscriber.email.unsuscribe') !!}</a></small>
<small><a href="{{ $unsubscribeLink }}">{!! trans('cachet.subscriber.email.unsuscribe') !!}</a></small>
</p>
@stop

View File

@@ -19,6 +19,6 @@
<p>{!! trans('cachet.powered_by', ['app' => Setting::get('app_name')]) !!}</p>
@endif
<p>
<small><a href="{{ route('unsubscribe', $token) }}">{!! trans('cachet.subscriber.email.unsuscribe') !!}</a></small>
<small><a href="{{ $unsubscribeLink }}">{!! trans('cachet.subscriber.email.unsuscribe') !!}</a></small>
</p>
@stop