I want to retrieve store-email in phtml file so far i've fetched store data information like this but there's no info about e-mail address:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeInformation = $objectManager->create('Magento\Store\Model\Information');
$store = $objectManager->create('Magento\Store\Model\Store');
$storeInfo = $storeInformation->getStoreInformationObject($store); 
$storeData = $storeInfo->getData();

Tested and working

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();        

echo $conf = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('trans_email/ident_general/email');

Output owner@example.com

  • got this error Error filtering template: Invalid scope type '1' – Shell Suite Sep 12 '17 at 8:04
  • @ShellSuite update the code – Qaisar Satti Sep 12 '17 at 8:05
  • it prints nothing – Shell Suite Sep 12 '17 at 8:06
  • @ShellSuite i tested this code there was mistake now working fine – Qaisar Satti Sep 12 '17 at 8:11
  • thanks its working, is there a way to retieve like the sales e-mail and others store e-mail? – Shell Suite Sep 12 '17 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.