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/

How to send image attachment with email template in magento 2

For Attach image in email template, you need to override TransportBuilder Class from Magento\Framework\Mail\Template\TransportBuilder

For Send Email Magento 2 without image attachment refer link,  Send Mail from Custom module Magento 2

For Override TransportBuilder.php file in Magento 2, you need to create di.xml file.
Using di.xml file you can override any PHP class in Magento 2.

Continue reading “How to send image attachment with email template in magento 2”