I want to override a Magento 2 email in adminhtml, has anyone done this already and what is the correct way to do this?
I have tried it like this: app/design/{vendor}/{theme}/{module}/email
Thank you!
I want to override a Magento 2 email in adminhtml, has anyone done this already and what is the correct way to do this?
I have tried it like this: app/design/{vendor}/{theme}/{module}/email
Thank you!
Found it out myself!
1) I have created a custom module:
app/code/Vendor/Module/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_Module',
__DIR__
);
app/code/Vendor/Module/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="Magento\Theme\Model\View\Design">
<arguments>
<argument name="themes" xsi:type="array">
<item name="frontend" xsi:type="string">Magento/luma</item>
<item name="adminhtml" xsi:type="string">Vendor/backend</item>
</argument>
</arguments>
</type>
</config>
app/code/Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Backend"/>
</sequence>
</module>
</config>
2) in CLI use php -d memory_limit=-1 bin/magento setup:upgrade
3) After creating the module itself i have created the adminhtml folder:
app/design/adminhtml/Vendor/backend/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'adminhtml/Vendor/backend',
__DIR__
);
app/design/adminhtml/Vendor/backend/theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Vendor backend Theme</title>
<parent>Magento/backend</parent>
</theme>
4) And in the custom adminhtml folder you can now rewrite anything, i made a rewrite for the following file like this:
app/design/adminhtml/Vendor/backend/Module_Name/email/tracking.html
There a way to customize an email template, that is using Magento Admin - Email Templates
You can refer to this link: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-email.html#customize-email-admin
See my below example for override email template
For Example if you want to override customer new account email template
Copy email template from
vendor/magento/module-customer/view/frontend/email/account_new.html
to
/app/design/frontend/Vendor/YourTheme/Magento_Customer/email/account_new.html