How To Get A List of Email Templates Programmatically In Magento 2

How To Get A List of Email Templates Programmatically In Magento 2

Recently, during a custom extension development, there was a requirement to send customers’ an Email regarding the price. And, for this, I had to load all the default Magento Email templates.

Email template list in Magento 2

I used the below code to get a list of Email templates programmatically in Magento 2 and you can use it too, whenever you want to send an Email from the Magento 2 store.

Select the desired Email template from the list and hence the right Email will be sent accordingly to the customers.

Method to get a list of Email templates programmatically in Magento 2:

Create app/code/Vendor/Extension/Helper/Data.php:

That’s it.

Feel free to mention your doubts about this method in the Comments section below. I’d be happy to help.

Do share the solution to fellow developers via social media.

Thanks.

5
(based on 4 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply

SUBSCRIBE
3.8
(based on 5 Reviews)