Open chipsmaster opened 6 years ago
I'll detail here the fix i may use in my project (this is not necessarily the fix to be used by Magento)
The safest choice i think is to use a dedicated Asset Repository instance (instead of a singleton) during one Email Template processing (there is also its "baseUrl" argument to instantiate and change its class to Magento\Framework\Url instead of the backend one). Changing that could be achieved using di.xml configuration only. But i realized there are also a chain of objects during inline style generation that depend on Asset Repository and it could be too complicated to change everything
So my solution is to replace Asset Repository class by a custom (
@chipsmaster, thank you for your report. We've acknowledged the issue and added to our backlog.
same problem on 2.3.1: sending password recovery emails from the backend results in wrong asset urls.
@chipsmaster thanks for the workaround example code. unfortunately I found that it requires even more tweaking than this, as the locale
isn't properly set. my workaround was to enforce the new emulated store's locale by adding it to $params
in a updateDesignParams
override.
Hi @chipsmaster, Could you confirm that this issue still reproducing on 2.4-develop branch?
@ihor-sviziev this is still an issue in 2.4.2-p1 - static assets in order confirmation mails sent from the magento admin gui have admin static assets included. to reproduce it, ensure the magento backend uses a different domain, f.e. frontend: www.shop.com, backend: admin.shop.com
Theme assets are managed by Magento\Framework\View\Asset\Repository and there are problems with it when using "app emulation" (used by email template processing) :
I put the two issues in same ticket to keep them in mind when reworking this asset management if any
I used the "Reset password" feature to demonstrate the issues but it's the same with order confirmation email.
Preconditions
Steps to reproduce
Expected result
Actual result