We have this weird issue on one of our websites.
When customers try to buy something they get an error 500 when they complete the order, the order is registered but they get an error 500 and no email is sent to the customer.
This also happens when a new customer is registering, so when they hit submit they get an error 500 and the registration is stored in Magento.
We also get error 500 in Magento when we try to click on the "reset password" button.
The reason why I think it has something to do with emails is that all of these actions should trigger an email to the customer. However, We have tested the email and it works.
This is what i get in the error logs:
==> var/log/exception.log <==
[2021-10-11 14:47:59] main.CRITICAL: Notice: Undefined index: directiveName in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Filter/DirectiveProcessor/SimpleDirective.php on line 68 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: directiveName in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Filter/DirectiveProcessor/SimpleDirective.php on line 68 at /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/App/ErrorHandler.php:61)"} []
==> ../../logs/php-error.log <==
[11-Oct-2021 14:47:59 UTC] PHP Fatal error: Uncaught TypeError: Return value of Magento\Framework\Filter\DirectiveProcessor\DependDirective::process() must be of the type string, object returned in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Filter/DirectiveProcessor/DependDirective.php:47
Stack trace:
#0 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Filter/Template.php(184): Magento\Framework\Filter\DirectiveProcessor\DependDirective->process(Array, Object(Magento\Email\Model\Template\Filter), Array)
#1 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/module-email/Model/Template/Filter.php(1080): Magento\Framework\Filter\Template->filter('<!-- End Conten...')
#2 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/module-email/Model/AbstractTemplate.php(369): Magento\Email\Model\Template\Filter->filter('<!-- End Conten...')
#3 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/module-email/Model/AbstractTemplate.php(247): Magento\Email\Model\AbstractTempla in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Filter/DirectiveProcessor/DependDirective.php on line 47
<!-- End Content -->
</td>
</tr>
<tr>
<td class="footer">
<table>
<tr>
<td>
<p><a href="https://cobi.no/om-cobi-norge">Om Cobi Norge</a></p>
<p><a href="https://cobi.no/nyheter.html">Forhandlernytt</a></p>
</td>
<td>
{{depend store_phone}}
<p class="phone">
{{trans '<a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}
</p>
{{/depend}}
{{depend store_hours}}
<p class="hours">
Åpningstider: <br />{{<span class="no-link">%store_hours</span>.' store_hours=$store_hours |raw}}
</p>
{{/depend}}
</td>
<td>
<p class="address">
Kabelgata 8<br/>
0580 Oslo<br/>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
{{depends xyz}}
inserted that are no longer valid in Magento’s new version. This happened to me when I upgraded my version of Magento from 2.2 to 2.3 . Magento remembered to upgrade everything but the old email templates and I had to edit them manually to be compatible. I found the solution by googling the error about “Depend Directive email error after Magento upgrade”. Sorry my answer could be better but it’s ~2am and my phone’s about to die 😲.