<?php
declare(strict_types=1);

namespace Leadlion\SalesOrder\Model;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;

class Config
{
    const XML_PATH_EMAIL_SENDER     = 'trans_email/ident_support/email';
    const XML_PATH_EMAIL_SENDERNAME     = 'trans_email/ident_support/name';
    const XML_PATH_EMAIL_TEMPLATE   = 'massemaildocument/email/template';

    /**
     * @var ScopeConfigInterface
     */
    protected $scopeConfig;

    /**
     * @param ScopeConfigInterface $scopeConfig
     */
    public function __construct(
        ScopeConfigInterface $scopeConfig
    ) {
        $this->scopeConfig = $scopeConfig;
    }

    /**
     * Retrieve Sender
     *
     * @param int $store
     * @return mixed
     */
    public function getSenderEmail($store = null)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_EMAIL_SENDER,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }

    /**
     * Retrieve Sender
     *
     * @param int $store
     * @return mixed
     */
    public function getSenderName($store = null)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_EMAIL_SENDERNAME,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }

    /**
     * Retrieve Email Template
     *
     * @param int $store
     * @return mixed
     */
    public function getEmailTemplate($store = null)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_EMAIL_TEMPLATE,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }
}
