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',
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user