Posted on

Magento 2 email template fails

I have a problem with my site processing email templates.

When I click preview on any email template it just produces a blank document.
I have tried this with standard inbuilt templates and very simple templates with no variables, it always comes up blank.

When I make an order on the site, when it returns to the site from the payment provider, it tries to send the email, generates a 500 error and indicates that the order has failed.

In fact the payment has gone through, and the email has been sent multiple times, up to 9 times in one case.

> [16-Nov-2019 15:21:37 UTC] PHP Fatal error: Uncaught TypeError:
> Argument 1 passed to MagentoEmailModelTemplate::setVars() must be
> of the type array, null given, called in
> /vendor/magento/framework/Mail/Template/TransportBuilder.php on line
> 368 and defined in /vendor/magento/module-email/Model/Template.php:403
> Stack trace:
> #0 /vendor/magento/framework/Mail/Template/TransportBuilder.php(368): MagentoEmailModelTemplate->setVars(NULL)
> #1 /vendor/magento/framework/Mail/Template/TransportBuilder.php(380): MagentoFrameworkMailTemplateTransportBuilder->getTemplate()
> #2 /vendor/magento/framework/Mail/Template/TransportBuilder.php(337): MagentoFrameworkMailTemplateTransportBuilder->prepareMessage()
> #3 /vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php(91):
> MagentoFrameworkMailTemplateTransportBuilder->getTransport()
> #4 /vendor/magento/module-sal in /vendor/magento/module-email/Model/Template.php on line 403

Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *