Information missing - How to include custom template from theme?
General issue
Description:
https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-email.html
I have a custom template in THEME/Magento_Email/email/usp_block.html
How can I include it in another template?
I tried it with {{template config_path="design/email/usp_block_template"}}
and {{template config_path="design/email/usp_block"}} but it says Email template '' is not defined.
Please add the missing information. Thx.
Possible solutions:
Additional information:
Hi @Eddcapone. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Easy way Maybe you don't have to do that (include external template). Include block in your email I think the suitable way is create custom template email and call it inside admin. Modify later and add your content you want. Add content, variables.v.v
<PATH> equals the XPATH to the system configuration value that contains the value of the template.
Here is where magento define template config.xml https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Email/etc/config.xml#L12
define template email https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Email/etc/email_templates.xml#L9
So make sure you have define custom template in THEME/Magento_Email/email/usp_block.html in xml file email_templates.xml too

Then in your template just try to call block template {{template config_path="your/path/usp_block"}}
@Eddcapone What do you think of the suggestion from @mrtuvn ?
I don't have the time to try it out at the moment unfortunatelly. I will report back asap. Thx!
@Eddcapone Is this still an issue? If you still need assistance, please create a ticket in the new repo: https://github.com/AdobeDocs/commerce-frontend-core/pulls
This page is now located at: https://developer.adobe.com/commerce/frontend-core/guide/templates/email/