magento2-frontools icon indicating copy to clipboard operation
magento2-frontools copied to clipboard

WIP: Experimental implementation for compiling email templates (usage from foundation for emails)

Open marvinhuebner opened this issue 6 years ago • 4 comments

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 and inliner and the tasks are inky, 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.

marvinhuebner avatar Nov 09 '18 15:11 marvinhuebner

I've tried to fix the merge conflicts, but current master throws errors in babel task:

[22:20:38] gulp-notify: [Error running Gulp] Error: .presets must be an array, or undefined
[22:20:38] gulp-notify: [Error running Gulp] Error: .presets must be an array, or undefined
[22:20:38] gulp-notify: [Error running Gulp] Error: .presets must be an array, or undefined
[22:20:38] gulp-notify: [Error running Gulp] Error: .presets must be an array, or undefined
...

I think that comes from the update from gulp-babel. So I will not merge current master in this feature and will wait till this is fixed.

marvinhuebner avatar Nov 29 '18 21:11 marvinhuebner

@marvinhuebner master and develop are now in good shape, you can merge and test it. I just keep temporarily on the master bunch of package upgrades, to make Greenkeeper happier 😄

Igloczek avatar Dec 18 '18 13:12 Igloczek

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.

marvinhuebner avatar Dec 18 '18 14:12 marvinhuebner

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.

Igloczek avatar Dec 18 '18 14:12 Igloczek