I'm making an export file of customer email addresses. Magento is set up to have two store views, each in different languages. How can I find out which store view the customer belongs to (i.e. her language)?
customer_entity table has a column
You can access it for example with $customer->getStoreId();
If you export the customers using your own class, you can add
\Magento\Store\Model\StoreManagerInterface as a dependency in the constructor. Then just loop over
$this->_storeManager->getStores(true); and check if the store-ID matches to get the store code.