We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    I have faced the issue while trying to override the Credit Memo Email template from the admin. The email template doesn’t include the item list in the email. So, I have made a small plugin for that.

    Step 1: You have to add this line in the Magemonkeys/SalesEmails/etc/di.xml

    <?xml version="1.0" ?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    	<type name="MagentoEmailModelTemplate">
    		<plugin disabled="false" name="Magemonkeys_SalesEmailTemplate_Plugin_Sales_Email_Model_Template" sortOrder="10" type="MagemonkeysSalesEmailTemplatePluginSalesEmails"/>
    	</type>
    </config>

    Step 2: Add the SalesEmails.php file on this ‘Magemonkeys/SalesEmailTemplate/Plugin’ location and add the below code in it.

    <?php
    declare(strict_types=1);
    
    namespace MagemonkeysSalesEmailTemplatePlugin;
    
    class SalesEmails 
    {
    
        public function beforeBeforeSave(MagentoEmailModelTemplate $subject)
        {
        	$subject->setData('is_legacy', 1);
            return [];
        }
    }
    

    That’s it.

    After executing above tech codes,  run the required command to see the effect.

    Note : Please delete the old custom template entry and made the new one.

    field_5bfb909c5ccae

      Get a Free Quote