-
-
Notifications
You must be signed in to change notification settings - Fork 83
Closed as not planned
Labels
Description
With the new Symfony Mime Component, in Symfony 4.3 experimental, it becomes accepted practice to make e-Mails with Twig. E-Mails require inline CSS, which is achieved thanks to an inline_css filter. Is there a recommended way on how to use webpack encore generated assets with the inline_css filter?
I see two possibilities as for the current possibilities (am I missing one, is one coming ahead?):
- Limit the email's css to one output file using some configuration, add a twig namespace linking to the output directory and then using something like
inline_css(source(encore_entry_css_files("my-email-entry")|first)) - Use a simple
{ filter inline_css }without opening the source, and dumping the source ourselfs into a<style>inside the filter. This way, we can have the loop{% for css_loc in encore_entry_css_files("my-email-entry") %}{{ source("@myBuildNamespace" ~ css_loc) }}{% endfor %}and therefore more than one output file. This case would be a further use case for [RFC] Inline assets #16
Best regards
Katrienvh, louisboulagnon, jnlr, deguif, dmaletta and 7 more