File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
app/code/Magento/Newsletter/Controller/Subscriber Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
* Copyright © Magento, Inc. All rights reserved.
5
5
* See COPYING.txt for license details.
6
6
*/
7
+
7
8
namespace Magento \Newsletter \Controller \Subscriber ;
8
9
10
+
11
+ /**
12
+ * Controller for unsubscribing customers.
13
+ */
9
14
class Unsubscribe extends \Magento \Newsletter \Controller \Subscriber
10
15
{
11
16
/**
12
17
* Unsubscribe newsletter
13
- * @return void
18
+ * @return \Magento\Backend\Model\View\Result\Redirect
14
19
*/
15
20
public function execute ()
16
21
{
@@ -27,6 +32,10 @@ public function execute()
27
32
$ this ->messageManager ->addException ($ e , __ ('Something went wrong while unsubscribing you. ' ));
28
33
}
29
34
}
30
- $ this ->getResponse ()->setRedirect ($ this ->_redirect ->getRedirectUrl ());
35
+ /** @var \Magento\Backend\Model\View\Result\Redirect $redirect */
36
+ $ redirect = $ this ->resultFactory ->create (\Magento \Framework \Controller \ResultFactory::TYPE_REDIRECT );
37
+ $ redirectUrl = $ this ->_redirect ->getRedirectUrl ();
38
+
39
+ return $ redirect ->setUrl ($ redirectUrl );
31
40
}
32
41
}
You can’t perform that action at this time.
0 commit comments