<?php
/**
 * @author Aitoc Team
 * @copyright Copyright (c) 2020 Aitoc (https://www.aitoc.com)
 * @package Aitoc_PreOrders
 */

/**
 * Copyright © 2018 Aitoc. All rights reserved.
 * Developed by Alex Yakimovich
 */

namespace Aitoc\PreOrders\Setup\Operations;

use Aitoc\PreOrders\Helper\Settings as SettingsHelper;

class SetDefaultValuesForEmailSenderSettings
{
    /**
     * @var SettingsHelper
     */
    private $settingsHelper;

    public function __construct(
        SettingsHelper $settingsHelper
    ) {
        $this->settingsHelper = $settingsHelper;
    }

    /**
     * @param $setup
     */
    public function execute()
    {
        $defaultSenderEmail = $this->settingsHelper->getCoreGeneralSenderEmail();
        $defaultSenderName = $this->settingsHelper->getCoreGeneralSenderName();
        $this->settingsHelper->setBackInStockNotificationSenderEmail($defaultSenderEmail);
        $this->settingsHelper->setBackInStockNotificationSenderName($defaultSenderName);
        $this->settingsHelper->setFollowUpNotificationSenderEmail($defaultSenderEmail);
        $this->settingsHelper->setFollowUpNotificationSenderName($defaultSenderName);
    }
}