Closed mindspace-devs closed 4 months ago
We don't consider this a bug. The Frontend Macros are designed to be used with a context and a context only. On Emails, sent from CoreShop Notification, you cannot expect to have a right context set, even before the change. Sometimes emails are triggered from a Frontend Controller, sometimes they might get triggered via a Payment Webhook were the context is also different.
The context you need for emails is basically the order, everything is persisted in there.
With the changes from this pull request https://github.com/coreshop/CoreShop/pull/2565/files currency formatting and other Store related functions cannot be used anymore in Notification Messages (e.g. Order Confirmation Mail).
So in CoreShop 4.0.4 and up this doesn't work anymore. When testing this make sure to completely wipe the cache, ca:cl didn't do enough on my part
code for testing:
{% import "@CoreShopFrontend/Common/Macro/currency.html.twig" as currency %}
{{ currency.convertAndFormat(order.total) }}