_scopeConfig = $scopeConfig; } /** * {@inheritdoc} */ public function resolve($sender, $scopeId = null) { $result = []; if (!is_array($sender)) { $result['name'] = $this->_scopeConfig->getValue( 'trans_email/ident_' . $sender . '/name', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $scopeId ); $result['email'] = $this->_scopeConfig->getValue( 'trans_email/ident_' . $sender . '/email', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $scopeId ); } else { $result = $sender; } if (!isset($result['name']) || !isset($result['email'])) { throw new \Magento\Framework\Exception\MailException(__('Invalid sender data')); } return $result; } }