Magento – Magento 2 get list of email templates

email-templates

I have added a new Magento 2 email template from Marketing->Communications->Email Templates.

How do I get a list of them in my custom extension code? What class/model do I need to call to be able to get them all into an array, or at least load one template by template ID.

Thanks!

Best Answer

  $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 
  $alltemplele = $objectManager->get('Magento\Email\Model\Template\Config');

  $alltemplele_data =$alltemplele->getAvailableTemplates();
  print_r($alltemplele_data);
Related Topic