I have a controller that load order like this:
$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load($id);
Is there a way to get a customer e-mail address by load order by id like this?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityTry this :
$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load($id);
$email = $order->getCustomerEmail();
To get Customer Id :
$customerId = $order->getCustomerId();
Get Customer Id
from order details and load your customer and you can get Customer Email
.
UPDATE:
$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load($id);
$customerId = $order->getCustomerId();