Skip to content

Commit

Permalink
Merge remote-tracking branch 'github-magento2ce/MAGETWO-91768' into E…
Browse files Browse the repository at this point in the history
…PAM-PR-12
  • Loading branch information
nikshostko committed Oct 2, 2018
2 parents 80efba1 + 02cbc33 commit 749586c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/code/Magento/Newsletter/Controller/Subscriber/Unsubscribe.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Newsletter\Controller\Subscriber;

class Unsubscribe extends \Magento\Newsletter\Controller\Subscriber
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;

/**
* Controller for unsubscribing customers.
*/
class Unsubscribe extends \Magento\Newsletter\Controller\Subscriber implements HttpGetActionInterface
{
/**
* Unsubscribe newsletter
* @return void
* Unsubscribe newsletter.
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
{
Expand All @@ -27,6 +32,9 @@ public function execute()
$this->messageManager->addException($e, __('Something went wrong while unsubscribing you.'));
}
}
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
/** @var \Magento\Backend\Model\View\Result\Redirect $redirect */
$redirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT);
$redirectUrl = $this->_redirect->getRedirectUrl();
return $redirect->setUrl($redirectUrl);
}
}

0 comments on commit 749586c

Please sign in to comment.