-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Experimental implementation for compiling email templates (usage from foundation for emails) #338
base: master
Are you sure you want to change the base?
Conversation
…rse inline css The packages are extracted from the the foundation-emails-template: - https://github.com/zurb/foundation-emails-template/blob/2f0cfa9a978ad7ced4ee3de33366224a90168724/package.json
…atch the email templates
… absolute paths and add patch See: foundation/panini#169
…mplates Since handlebars also uses curly braces and the raw helper is often a bit awkward, a new template helper ({!! and !!}) is introduced, which gets replaced after handlebars is compiled to the curly braces to be interpreted by magento.
Otherwise it would take only the options which are passed then creating the instance. But due the fact that there is the possibility to overwrite these files, it has to take the path from the current theme which gets compiled.
…ts which should be updated
…to refresh the partials in all renderers Panini exports an singleton, through that it holds all options and they can not be overwritten. This change adds a new panini instance for each task to hold it's own options. Panini is patched because Handlebars is also a singleton, so the partials will be overwritten. You can find more infos here: foundation/panini#81 (comment)
I've tried to fix the merge conflicts, but current master throws errors in babel task:
I think that comes from the update from |
@marvinhuebner master and develop are now in good shape, you can merge and test it. |
Hey @Igloczek, thanks for the info, will test it soon! I would be interested in your general opinion on a implementation like this. Do you see potential here? Also, I would be interested if there are still ambitions for a v2 frontools, because if there would be a plugin system, that would certainly be perfect for something like this. |
TBH I didn't read it yet, will get into this as soon as I can. Probably I'm not going to create Frontools V2. We are moving out of typical almost clean M2 projects into SPA / PWA oriented apps, so this tools will be in use mostly in existing projects, which means I will probably just maintain it, but not create anything new. |
First of all, I would like to say that I am aware that this adjustments probably will not be merged and we have to use our fork, but I want to open this PR anyway, in order to possibly trigger a discussion. Maybe that's also interesting for others.
This PR implements zurb/panini, zurb/inky and an inline-css plugin to basically use foundation for emails. The gulp tasks are adopted from zurb/foundation-emails-template.
With this toolset you're having the possibility to create your own email templates without the pain of writing html tables, because inky will provide syntactic sugar and will take convert your code to tables etc. See here: https://foundation.zurb.com/emails/docs/inky.html
I integrated the tasks into frontools to use the existing features like inheritance and the watcher. There are 2 new helper and 4 new tasks. The helper are
inky
andinliner
and the tasks areinky
,inliner
,email
(building emails for production with inliner),dev:email
(tasks for developing email templates with watcher and browser sync for preview).I've recorded a little example which will show how it's working: https://demo-frontools-email-wfttfpigcx.now.sh/
At the end I would like to say once again, that I'm aware that this will very likely not get merged. There are still some points that need to be solved, for example there is a pending patch for panini to get it working with absolute paths, i will do further testing and maybe fix some things and the readme needs to be adjusted do document the new tasks.
I think with the ideas for frontools 2.0 #201, it will be much easier to add something like this as a plugin.
And finally thanks for this great tool 🙏🏻, this makes developing magento 2 themes much more friendly. Without frontools, it's really cumbersome.