cancel
Showing results for 
Search instead for 
Did you mean: 

main.ERROR: Email template '' is not defined. [] []

main.ERROR: Email template '' is not defined. [] []

Hi Everyone,

 

I hope you can help me on this one as I am stuck here for a couple of days.


Here is what I have installed.

1) Magento ver. 2.4.2

2) Porto Theme
3) MageStore WebPOS

4) MagePlaza SMTP

5) Website migrated by one of the popular migration services.

When I click the "Send Email" button on Order/Invoice/Credit Memo etc, I get the following error in system.log

 

main.ERROR: Email template '' is not defined. [] []

 

I am not sure how to fix this.

 

Any help would be appreciated as I cannot launch our migrated site with these issues.

7 REPLIES 7

Re: main.ERROR: Email template '' is not defined. [] []

I am still experiencing this issue and after doing some digging, I see that this is the code that is causing throwing the exception.

 

vendor/magento/module-email/Model/Template/Config.php:225

    protected function _getInfo($templateId, $fieldName)
    {
        $data = $this->_dataStorage->get();
        if (!isset($data[$templateId])) {
            throw new \UnexpectedValueException("Email template '{$templateId}' is not defined.");
        }
        if (!isset($data[$templateId][$fieldName])) {
            throw new \UnexpectedValueException(
                "Field '{$fieldName}' is not defined for email template '{$templateId}'."
            );
        }
        return $data[$templateId][$fieldName];
    }
 
I am only using default templates and I am not using any custom templates. I am not sure why this is happening.

Hoping that someone can help me out on this.

Re: main.ERROR: Email template '' is not defined. [] []

Hey @HussainBaig,

 

Go to Store -> Setting -> Configuration
under the Sales Tab -> Sales Emails -> Credit memo section

Select Template for Credit Memo.

 

Create it if not exists from Marketing -> Communications -> Email Templates

 

 

Re: main.ERROR: Email template '' is not defined. [] []

Hi @HussainBaig,

 

The problem most likely comes from the SMTP module of Mageplaza. You can disable this module and try configure and send email using Magento's default function. 

 

Hope this can help you! Let me know if you need further assistance. 

_________

If issue solved, Click Kudos & Accept as Solution.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: main.ERROR: Email template '' is not defined. [] []

So basically what I had done was take backups of my full website before milestone (every time I installed something).

Therefore, I was able to determine that this issue is being caused by WebPOS. I have filed a ticket with Magestore WebPOS and they are looking at it. 

As for Mageplaza SMTP, their developer was very helpful. I shadowed him for 2 days while he took control of my computer and tried to troubleshoot the issue. It was determined that it was not Mageplaza SMTP.

 

I will update this ticket when I have some news from Magestore WebPOS.

 

Regards,
Hussain

Re: main.ERROR: Email template '' is not defined. [] []

Magestore was able to determine the issue and provided me with a patch to fix this up.

Issue has been resolved.

Re: main.ERROR: Email template '' is not defined. [] []

Hi @HussainBaig,

 

Great to hear that!

 

If you need further assistance, please let me know. 

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: main.ERROR: Email template '' is not defined. [] []

I have the same error. Can you share the patch please?