1

When creating a custom email header for a email template it gives an error in the email's body.

Error filtering template: Email template '' is not defined

I have placed in the header using this convention in the email template body (which is just overridden in the theme email)

{{template config_path="design/email/design_email_header_changed_template"}}

I have put the template id into email_templates.xml inside the main module (I know it's bad practice, but for now, please humour me till I fix the main issue)

It is as if it doesn't find it's name for whatever reason or something? It is literally two ' in a row with no name. I did at the time have a - in the label in the section below. It might not have liked that?

<template id="design_email_header_changed_template" label="Header Changed" file="changed_header.html" type="html" module="Magento_Email" area="frontend"/>

I have put the template header in the module under the frontend folder on the root as well as the theme folder (again, I know bad practice, but I'm just trying to figure out what is going on).

I have also updated the config.xml to include the header template:

<header_template>design_email_header_changed_template</header_template>

I am unsure of what I am doing wrong for the system to not retrieve the html file to spit out the template or, rather find the template.

Thanks!

  • i have same issue – bhargav shastri Nov 27 '18 at 14:07
  • Please see my answer below -- it may be a good workaround to your issue. – GuitarKat Nov 28 '18 at 23:21
1

I couldn't fix the main issue, so this is what I did.

I made the "header" kind of extend to the email body. For example, order_email.html and added a CMS block call to there (I know, right!). Within the main admin area, I created a new CMS block and pasted the image (in my case) there. I made sure to name the block so I would be able to call it in the email.

In certain emails where I wanted the CMS block to show, I did this (Magento_Sales/email/order_new.html) - in a template (var/www/magento2/..../app/design/frontend/theme_name/Magento_Sales/email/order_new.html)- as an example:

{{block class="Magento\Cms\Block\Block" area='frontend' block_id="thank_you"}}

Hope this helps someone! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.