Skip to content

Commit c6697f0

Browse files
committed
MC-4242: Newsletter subscriptions per website
1 parent 5354836 commit c6697f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Customer\Controller\Adminhtml\Index;
77

8+
use Magento\Backend\Model\View\Result\Redirect;
89
use Magento\Customer\Api\CustomerRepositoryInterface;
910
use Magento\Customer\Api\Data\CustomerInterface;
1011
use Magento\Customer\Model\Config\Share;
@@ -48,6 +49,7 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf
4849
* @param CollectionFactory $collectionFactory
4950
* @param CustomerRepositoryInterface $customerRepository
5051
* @param SubscriptionManagerInterface $subscriptionManager
52+
* @param StoreManagerInterface $storeManager
5153
* @param Share $shareConfig
5254
*/
5355
public function __construct(
@@ -70,13 +72,13 @@ public function __construct(
7072
* Customer mass unsubscribe action
7173
*
7274
* @param AbstractCollection $collection
73-
* @return \Magento\Backend\Model\View\Result\Redirect
75+
* @return Redirect
7476
*/
7577
protected function massAction(AbstractCollection $collection)
7678
{
7779
$customersUpdated = 0;
7880
foreach ($collection->getAllIds() as $customerId) {
79-
// Verify customer exists
81+
// Verify that customer exists
8082
$customer = $this->customerRepository->getById($customerId);
8183
foreach ($this->getUnsubscribeStoreIds($customer) as $storeId) {
8284
$this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId);
@@ -87,7 +89,7 @@ protected function massAction(AbstractCollection $collection)
8789
if ($customersUpdated) {
8890
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated));
8991
}
90-
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
92+
/** @var Redirect $resultRedirect */
9193
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
9294
$resultRedirect->setPath($this->getComponentRefererUrl());
9395

0 commit comments

Comments
 (0)