Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-newsletter
Controller
Subscriber
Confirm.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Newsletter\Controller\Subscriber
;
8
9
class
Confirm
extends
\Magento\Newsletter\Controller\Subscriber
10
{
15
public
function
execute
()
16
{
17
$id
= (int)$this->
getRequest
()->getParam(
'id'
);
18
$code
= (string)$this->
getRequest
()->getParam(
'code'
);
19
20
if
(
$id
&&
$code
) {
22
$subscriber
= $this->_subscriberFactory->create()->load(
$id
);
23
24
if
(
$subscriber
->getId() &&
$subscriber
->getCode()) {
25
if
(
$subscriber
->confirm(
$code
)) {
26
$this->messageManager->addSuccess(
__
(
'Your subscription has been confirmed.'
));
27
}
else
{
28
$this->messageManager->addError(
__
(
'This is an invalid subscription confirmation code.'
));
29
}
30
}
else
{
31
$this->messageManager->addError(
__
(
'This is an invalid subscription ID.'
));
32
}
33
}
34
35
$resultRedirect = $this->resultRedirectFactory->create();
36
$resultRedirect->setUrl($this->_storeManager->getStore()->getBaseUrl());
37
return
$resultRedirect;
38
}
39
}
$id
$id
Definition:
fieldset.phtml:14
__
__()
Definition:
__.php:13
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Newsletter\Controller\Subscriber
Definition:
Subscriber.php:18
Magento\Newsletter\Controller\Subscriber\Confirm
Definition:
Confirm.php:9
Magento\Newsletter\Controller\Subscriber
Definition:
Confirm.php:7
$subscriber
$subscriber
Definition:
subscribers.php:20
$code
$code
Definition:
info.phtml:12