Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Sending.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  // Todo: put it somewhere in config!
19  $countOfQueue = 3;
20  $countOfSubscriptions = 20;
21 
22  $collection = $this->_objectManager->create(
23  \Magento\Newsletter\Model\ResourceModel\Queue\Collection::class
24  )->setPageSize(
25  $countOfQueue
26  )->setCurPage(
27  1
28  )->addOnlyForSendingFilter()->load();
29 
30  $collection->walk('sendPerSubscriber', [$countOfSubscriptions]);
31  }
32 }