scopeConfig->isSetFlag( self::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE ); } /** * Get order status filter * * @return array */ public function getOrderStatus() { $value = $this->scopeConfig->getValue( self::XML_PATH_ORDER_STATUS, ScopeInterface::SCOPE_STORE ); if (is_string($value)) { return explode(',', $value); } return is_array($value) ? $value : ['complete']; } /** * Check if email is enabled * * @return bool */ public function isEmailEnabled() { return $this->scopeConfig->isSetFlag( self::XML_PATH_EMAIL_ENABLED, ScopeInterface::SCOPE_STORE ); } /** * Get email recipients * * @return array */ public function getEmailRecipients() { $recipients = $this->scopeConfig->getValue( self::XML_PATH_EMAIL_RECIPIENTS, ScopeInterface::SCOPE_STORE ); if (empty($recipients)) { return []; } return array_map('trim', explode(',', $recipients)); } /** * Get email subject * * @param string $month * @param string $year * @return string */ public function getEmailSubject($month = null, $year = null) { $subject = $this->scopeConfig->getValue( self::XML_PATH_EMAIL_SUBJECT, ScopeInterface::SCOPE_STORE ); if ($month && $year) { $subject = str_replace(['{{month}}', '{{year}}'], [$month, $year], $subject); } return $subject ?: 'Monthly Thermo Report'; } /** * Get email sender * * @return string */ public function getEmailSender() { return $this->scopeConfig->getValue( self::XML_PATH_EMAIL_SENDER, ScopeInterface::SCOPE_STORE ) ?: 'general'; } }