Skip to content
Snippets Groups Projects

ZERO-162-changes

Open Eduarda Lentz Rodrigues da Silva requested to merge ZERO-162-changes into develop
Compare and
7 files
+ 345
215
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -20,12 +20,13 @@ declare(strict_types=1);
namespace Firegento\ContentProvisioning\Cron;
use Firegento\ContentProvisioning\Model\Console\BlockListCommand;
use Firegento\ContentProvisioning\Model\RenderChangedBlockList;
use Magento\Framework\Mail\Message;
use Psr\Log\LoggerInterface;
use Magento\Framework\Mail\TransportInterfaceFactory;
use Magento\Framework\App\Config\ScopeConfigInterface;
class InconsistenciesInBlockEmailTest
class InconsistenciesInBlockEmail
{
public const EMAIL_SUBJECT = "Inconsistencies in CMS block";
@@ -58,25 +59,33 @@ class InconsistenciesInBlockEmailTest
*/
private ScopeConfigInterface $scopeConfig;
/**
* @var RenderChangedBlockList
*/
private RenderChangedBlockList $renderChangedBlockList;
/**
* @param LoggerInterface $logger
* @param BlockListCommand $blockList
* @param TransportInterfaceFactory $mailTransportFactory
* @param Message $message
* @param ScopeConfigInterface $scopeConfig
* @param RenderChangedBlockList $renderChangedBlockList
*/
public function __construct(
LoggerInterface $logger,
BlockListCommand $blockList,
TransportInterfaceFactory $mailTransportFactory,
Message $message,
ScopeConfigInterface $scopeConfig
ScopeConfigInterface $scopeConfig,
RenderChangedBlockList $renderChangedBlockList
) {
$this->logger = $logger;
$this->blockList = $blockList;
$this->mailTransportFactory = $mailTransportFactory;
$this->message = $message;
$this->scopeConfig = $scopeConfig;
$this->renderChangedBlockList = $renderChangedBlockList;
}
/**
@@ -89,7 +98,7 @@ class InconsistenciesInBlockEmailTest
{
$changedBlocks = $this->blockList->getChangedEntries();
if ($changedBlocks) {
$emailMessage = $this->blockList->renderValuesForEmail($changedBlocks);
$emailMessage = $this->renderChangedBlockList->renderValuesForEmail($changedBlocks);
$this->sendEmail($emailMessage);
} else {
$this->logger->info("No changed blocks found.");
Loading