How to get customer data by customer email in magento 2?

You can get customer information by just passing customer email using below code snippet, Create Block file,

Call getCustomerByEmail() function in template file,

Get all customer data by below way,
echo “<pre>”;print_r($customer->__toArray());

For, Get customer data by customer id using below link, https://www.rakeshjesadiya.com/how-to-get-customer-data-by-customer-id-magento-2/

Leave a Reply

Your email address will not be published. Required fields are marked *